mirror of
https://github.com/avatao-content/baseimage-tutorial-framework
synced 2024-11-22 19:21:31 +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 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()
|
||||
|
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user