def stop(): """Stop logging """ storm_debug(False)
def start(cls): """Start logging """ obj = cls.fromFullPath('logs/storm.log') storm_debug(True, stream=obj)
def stop(): """Stop logging """ storm_debug(False)
app.config.from_object('config.Local') elif '/prod/' in _app_path: app.config.from_object('config.Product') else: app.config.from_object('config.Develop') app.url_map.strict_slashes = False app = Server(__name__) setup_app(app) from flaskext.cache import Cache cache = Cache(app) from flaskext.storm import use_storm use_storm(app) if app.debug: from storm.tracer import debug as storm_debug storm_debug(True, stream=sys.stdout) else: from logging import StreamHandler handler = StreamHandler(sys.stderr) handler.setLevel(logging.INFO) app.logger.addHandler(handler) @app.after_request def flush_log(response): handler.flush() return response
def start(cls): """Start logging """ obj = cls.fromFullPath('logs/storm.log') storm_debug(True, stream=obj)