1
0
mirror of https://github.com/checktheroads/hyperglass synced 2024-05-11 05:55:08 +00:00

fix debug detection

This commit is contained in:
checktheroads
2020-07-19 14:46:20 -07:00
parent 9a45e0735c
commit 582cf21b44

View File

@@ -166,8 +166,12 @@ log.debug("Unvalidated configuration from {}: {}", CONFIG_MAIN, user_config)
params = _validate_config(config=user_config, importer=_params.Params)
# Re-evaluate debug state after config is validated
if params.debug and current_log_level(log) != "debug":
log_level = current_log_level(log)
if params.debug and log_level != "debug":
set_log_level(logger=log, debug=True)
elif not params.debug and log_level == "debug":
set_log_level(logger=log, debug=False)
# Map imported user commands to expected schema.
_user_commands = _config_optional(CONFIG_COMMANDS)