From eed3006055d67a681f8ba2102d318cd13bb5d578 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?B=C3=A1lint=20Bokros?= Date: Fri, 9 Feb 2018 14:06:11 +0100 Subject: [PATCH] Add logging to controller --- src/controller/app.py | 3 +++ src/controller/handlers/solution_check_handler.py | 4 ++++ 2 files changed, 7 insertions(+) diff --git a/src/controller/app.py b/src/controller/app.py index 8ee357a..02873a3 100644 --- a/src/controller/app.py +++ b/src/controller/app.py @@ -5,6 +5,8 @@ from tfw.config import CRP_LISTENER_PORT, AVATAO_SECRET from handlers import SolutionCheckHandler, TestHandler from tfw.networking.solvable_connector import SolvableConnector +from tfw.config.logs import logging +log = logging.getLogger(__name__) if __name__ == '__main__': solvable_connector = SolvableConnector() @@ -16,4 +18,5 @@ if __name__ == '__main__': routes ) app.listen(CRP_LISTENER_PORT) + log.debug('Controller listening on {}'.format(CRP_LISTENER_PORT)) IOLoop.instance().start() diff --git a/src/controller/handlers/solution_check_handler.py b/src/controller/handlers/solution_check_handler.py index b45d7fd..5a79feb 100644 --- a/src/controller/handlers/solution_check_handler.py +++ b/src/controller/handlers/solution_check_handler.py @@ -1,11 +1,15 @@ from tornado.web import RequestHandler +from tfw.config.logs import logging +log = logging.getLogger(__name__) class SolutionCheckHandler(RequestHandler): def initialize(self, solvable_connector): self.solvable_connector = solvable_connector def get(self): + log.debug('Sending request to solvable') self.solvable_connector.send('solution_check', {}) resp_key, resp_data = self.solvable_connector.recv() + log.debug('Received answer from solvable') self.write(resp_data)