From 56e47c51ed25d19f8cf9fb12d8d7fee0f624afaa Mon Sep 17 00:00:00 2001 From: Xavier Morel Date: Mon, 2 Dec 2019 12:38:49 +0000 Subject: [PATCH] [REV] core: logger configuration part of 6044782aeffc61955b956068b0a4d58fa33303f0 Configuring the non-root logger based on --log-level had the side-effect (unclear whether it was intended or not as none of the relevant commits really documented the idea) that log-level could override log handlers being set on the root logger e.g. if `log_handler = :INFO` is set in the config file, `--log-level=warn` on the CLI will override it. This could be replicated by swapping `pseudo_config` and `logconfig`, *however* it would also make the sub-loggers override differently (currently on an exact logger match log-handler overrides log-level). The ideal fix would likely be to sequence log-level from the configuration file, log-handler from the configuration file, log-level from the CLI and log-handler from the CLI. However that doesn't really work with the current structure. closes odoo/odoo#41180 Signed-off-by: Xavier Morel (xmo) --- odoo/netsvc.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/odoo/netsvc.py b/odoo/netsvc.py index a3baf70f89a..2cf24a36a61 100644 --- a/odoo/netsvc.py +++ b/odoo/netsvc.py @@ -215,12 +215,12 @@ DEFAULT_LOG_CONFIGURATION = [ ':INFO', ] PSEUDOCONFIG_MAPPER = { - 'debug_rpc_answer': [':DEBUG', 'odoo.sql_db:INFO', 'odoo.http.rpc:DEBUG'], - 'debug_rpc': [':DEBUG', 'odoo.sql_db:INFO', 'odoo.http.rpc.request:DEBUG'], - 'debug': [':DEBUG', 'odoo.sql_db:INFO'], + 'debug_rpc_answer': ['odoo:DEBUG', 'odoo.sql_db:INFO', 'odoo.http.rpc:DEBUG'], + 'debug_rpc': ['odoo:DEBUG', 'odoo.sql_db:INFO', 'odoo.http.rpc.request:DEBUG'], + 'debug': ['odoo:DEBUG', 'odoo.sql_db:INFO'], 'debug_sql': ['odoo.sql_db:DEBUG'], 'info': [], - 'warn': [':WARNING'], - 'error': [':ERROR'], - 'critical': [':CRITICAL'], + 'warn': ['odoo:WARNING', 'werkzeug:WARNING'], + 'error': ['odoo:ERROR', 'werkzeug:ERROR'], + 'critical': ['odoo:CRITICAL', 'werkzeug:CRITICAL'], }