From 0cca315106906e87ee7694fa860517ca8f248802 Mon Sep 17 00:00:00 2001 From: Bruno Wagner Date: Thu, 23 Oct 2014 11:54:29 +0200 Subject: --debug is working again --- service/pixelated/runserver.py | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) (limited to 'service/pixelated/runserver.py') diff --git a/service/pixelated/runserver.py b/service/pixelated/runserver.py index 49ad0067..68eaa840 100644 --- a/service/pixelated/runserver.py +++ b/service/pixelated/runserver.py @@ -15,9 +15,8 @@ # along with Pixelated. If not, see . import os -import sys import os.path -import crochet +import logging from flask import Flask from leap.common.events import server as events_server from pixelated.config import app_factory @@ -30,11 +29,6 @@ import pixelated.support.ext_protobuf # monkey patch for protobuf in OSX app = Flask(__name__, static_url_path='', static_folder=app_factory.get_static_folder()) -import logging -logging.basicConfig() -logger = logging.getLogger('werkzeug') -logger.setLevel(logging.INFO) - def setup(): try: @@ -43,7 +37,11 @@ def setup(): reactor_manager.start_reactor(logging=debug_enabled) crochet.setup() - events_server.ensure_server(port=8090) + debug_enabled = args.debug or os.environ.get('DEBUG', False) + if(not debug_enabled): + logging.basicConfig() + logger = logging.getLogger('werkzeug') + logger.setLevel(logging.INFO) app.config.update({'HOST': args.host, 'PORT': args.port}) -- cgit v1.2.3