diff options
| author | schneefux <schneefux+commit@schneefux.xyz> | 2017-03-01 20:13:52 +0100 |
|---|---|---|
| committer | schneefux <schneefux+commit@schneefux.xyz> | 2017-03-01 20:13:52 +0100 |
| commit | 5a79b51666eb48ddd5d2b1a8a0b5e42d4383fe16 (patch) | |
| tree | d76a2c4dc3a281bb5cde33d82eb19c48583bfd9a | |
| parent | 4a6f14706e5b837c1ffeaafeaceac2f9971d1420 (diff) | |
| download | compiler-5a79b51666eb48ddd5d2b1a8a0b5e42d4383fe16.tar.gz compiler-5a79b51666eb48ddd5d2b1a8a0b5e42d4383fe16.zip | |
log to file
| -rw-r--r-- | api.py | 13 | ||||
| -rw-r--r-- | logs/.gitignore | 1 |
2 files changed, 12 insertions, 2 deletions
@@ -34,7 +34,7 @@ class Worker(object): async def connect(self, dbconf, queuedb): """Connect to database.""" - logging.info("connecting to database") + logging.warning("connecting to database") self._queue = joblib.joblib.JobQueue() await self._queue.connect(**queuedb) await self._queue.setup() @@ -95,7 +95,16 @@ async def startup(): await worker.setup() await worker.start(4) -logging.basicConfig(level=logging.DEBUG) + +logging.basicConfig( + filename="logs/apigrabber.log", + filemode="a", + level=logging.DEBUG +) +console = logging.StreamHandler() +console.setLevel(logging.WARNING) +logging.getLogger("").addHandler(console) + loop = asyncio.get_event_loop() loop.run_until_complete(startup()) loop.run_forever() diff --git a/logs/.gitignore b/logs/.gitignore new file mode 100644 index 0000000..397b4a7 --- /dev/null +++ b/logs/.gitignore @@ -0,0 +1 @@ +*.log |
