summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--api.py16
-rw-r--r--logs/.gitignore1
2 files changed, 15 insertions, 2 deletions
diff --git a/api.py b/api.py
index 24080b2..d6289cc 100644
--- a/api.py
+++ b/api.py
@@ -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,19 @@ async def startup():
await worker.setup()
await worker.start(4)
-logging.basicConfig(level=logging.DEBUG)
+
+logging.basicConfig(
+ filename=os.path.realpath(
+ os.path.join(os.getcwd(),
+ os.path.dirname(__file__))) +
+ "/logs/compiler.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