Mercurial > odfcast
changeset 14:53c7a99cabae
Set log level to debug if config["DEBUG"] is set
author | Björn Ricks <bjoern.ricks@intevation.de> |
---|---|
date | Fri, 26 Sep 2014 20:18:16 +0200 |
parents | 75d90af41dfa |
children | d2fb4862adb8 |
files | main.py |
diffstat | 1 files changed, 6 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/main.py Fri Sep 26 20:17:33 2014 +0200 +++ b/main.py Fri Sep 26 20:18:16 2014 +0200 @@ -1,13 +1,17 @@ # -*- coding: utf-8 -*- +import logging from flask import Flask -from odfcast.convert import ConvertView, TemplateConvertView - app = Flask(__name__) app.config.from_object('odfcast.settings') app.config.from_envvar('ODFCAST_SETTINGS', silent=True) +if app.config["DEBUG"]: + logging.basicConfig(level=logging.DEBUG) + +from odfcast.convert import ConvertView, TemplateConvertView + app.add_url_rule("/convert/", view_func=ConvertView.as_view(