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():
|
||||
logger = logging.getLogger('werkzeug')
|
||||
try:
|
||||
log_conf = Config.get('logging')
|
||||
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
|
||||
|
|
Loading…
Reference in a new issue