From 36b727cab65adfe04df95574e9b790028c36b86d Mon Sep 17 00:00:00 2001 From: Filippo Giunchedi Date: Fri, 19 Aug 2022 14:42:56 +0200 Subject: [PATCH] Always upper log_level before logging config In other words don't require config/environment LOG_LEVEL to be upper case, also consistent with what --log-level expects. --- src/dispatch/logging.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/dispatch/logging.py b/src/dispatch/logging.py index 350b0b383cbd..40d1642ed486 100644 --- a/src/dispatch/logging.py +++ b/src/dispatch/logging.py @@ -3,9 +3,10 @@ def configure_logging(): - if LOG_LEVEL == "DEBUG": + level = LOG_LEVEL.upper() + if level == "DEBUG": # log level:logged message:full module path:function invoked:line number of logging call LOGFORMAT = "%(levelname)s:%(message)s:%(pathname)s:%(funcName)s:%(lineno)d" - logging.basicConfig(level=LOG_LEVEL, format=LOGFORMAT) + logging.basicConfig(level=level, format=LOGFORMAT) else: - logging.basicConfig(level=LOG_LEVEL) + logging.basicConfig(level=level)