From ddf66d3b7866ec1b1c7183fd3c3a00a5e372f5ea Mon Sep 17 00:00:00 2001 From: Matt Webb Date: Sat, 27 Sep 2014 15:26:54 +0100 Subject: [PATCH] adding a little logging --- app/__init__.py | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/app/__init__.py b/app/__init__.py index bf8e69d..edcf95c 100755 --- a/app/__init__.py +++ b/app/__init__.py @@ -53,15 +53,17 @@ def create_app(config_name): def coresocket(ws): print "here" sys.stdout.flush() - while True: + while True: + gevent.sleep() message = ws.receive() #pprint(message) - - #try: - event = json.loads(message) - with app.request_context(ws.environ): - process_event(ws, event, sender) - #except Exception, e: - # print "Exception: %r" % e + if message: + app.logger.info(u'Got message: {}'.format(message)) + #try: + event = json.loads(message) + with app.request_context(ws.environ): + process_event(ws, event, sender) + #except Exception, e: + # print "Exception: %r" % e print "app created" return app -- 2.47.3