forked from platypush/platypush
Don't fail hard if the web app is initialized without access to a configuration file (e.g. from a ReadTheDocs build environment)
This commit is contained in:
parent
aa5cbbce28
commit
10eb0c12aa
1 changed files with 7 additions and 3 deletions
|
@ -9,9 +9,13 @@ from platypush.backend.http.app.utils import get_routes
|
||||||
|
|
||||||
def initialize_logger():
|
def initialize_logger():
|
||||||
logger = logging.getLogger('werkzeug')
|
logger = logging.getLogger('werkzeug')
|
||||||
log_conf = Config.get('logging')
|
try:
|
||||||
if 'level' in log_conf:
|
log_conf = Config.get('logging')
|
||||||
logger.setLevel(log_conf['level'])
|
if 'level' in log_conf:
|
||||||
|
logger.setLevel(log_conf['level'])
|
||||||
|
except Exception as e:
|
||||||
|
logger.warning('Could not read logging level')
|
||||||
|
logger.exception(e)
|
||||||
|
|
||||||
|
|
||||||
## Webapp initialization
|
## Webapp initialization
|
||||||
|
|
Loading…
Reference in a new issue