mirror of
https://github.com/avatao-content/baseimage-tutorial-framework
synced 2024-11-22 23:51:32 +00:00
Add logging to controller
This commit is contained in:
parent
e39b8b9283
commit
eed3006055
@ -5,6 +5,8 @@ from tfw.config import CRP_LISTENER_PORT, AVATAO_SECRET
|
|||||||
from handlers import SolutionCheckHandler, TestHandler
|
from handlers import SolutionCheckHandler, TestHandler
|
||||||
from tfw.networking.solvable_connector import SolvableConnector
|
from tfw.networking.solvable_connector import SolvableConnector
|
||||||
|
|
||||||
|
from tfw.config.logs import logging
|
||||||
|
log = logging.getLogger(__name__)
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
solvable_connector = SolvableConnector()
|
solvable_connector = SolvableConnector()
|
||||||
@ -16,4 +18,5 @@ if __name__ == '__main__':
|
|||||||
routes
|
routes
|
||||||
)
|
)
|
||||||
app.listen(CRP_LISTENER_PORT)
|
app.listen(CRP_LISTENER_PORT)
|
||||||
|
log.debug('Controller listening on {}'.format(CRP_LISTENER_PORT))
|
||||||
IOLoop.instance().start()
|
IOLoop.instance().start()
|
||||||
|
@ -1,11 +1,15 @@
|
|||||||
from tornado.web import RequestHandler
|
from tornado.web import RequestHandler
|
||||||
|
|
||||||
|
from tfw.config.logs import logging
|
||||||
|
log = logging.getLogger(__name__)
|
||||||
|
|
||||||
class SolutionCheckHandler(RequestHandler):
|
class SolutionCheckHandler(RequestHandler):
|
||||||
def initialize(self, solvable_connector):
|
def initialize(self, solvable_connector):
|
||||||
self.solvable_connector = solvable_connector
|
self.solvable_connector = solvable_connector
|
||||||
|
|
||||||
def get(self):
|
def get(self):
|
||||||
|
log.debug('Sending request to solvable')
|
||||||
self.solvable_connector.send('solution_check', {})
|
self.solvable_connector.send('solution_check', {})
|
||||||
resp_key, resp_data = self.solvable_connector.recv()
|
resp_key, resp_data = self.solvable_connector.recv()
|
||||||
|
log.debug('Received answer from solvable')
|
||||||
self.write(resp_data)
|
self.write(resp_data)
|
||||||
|
Loading…
Reference in New Issue
Block a user