logger_config.py: added back in config yaml loading otherwise logging statements are silenced.

This commit is contained in:
appleb_m committed 2026-01-29 16:49:21 +01:00
1 parent ddec076fcf
commit 1058290099
1 file changed
+7 -7
+7 -7
View File
@@ -38,13 +38,13 @@ def setup_logger(name="aareDAQ", base_dir: str | None = '~/tmp/mxlogs', config_p
# switch to production mode using: $ APP_ENV=prod python main.py
env = os.getenv("APP_ENV", "dev") # default: dev
#if config_path is None:
# config_file = get_config_path(env)
#else:
# config_file = Path(config_path)
if config_path is None:
config_file = get_config_path(env)
else:
config_file = Path(config_path)
# with open(config_file, "r") as f:
# config = yaml.safe_load(f.read())
with open(config_file, "r") as f:
config = yaml.safe_load(f.read())
# Force base directory to be under the user's home dir
# effective_base = base_dir or '~/mxlogs'
@@ -65,7 +65,7 @@ def setup_logger(name="aareDAQ", base_dir: str | None = '~/tmp/mxlogs', config_p
#if log_dir and not os.path.exists(log_dir):
# os.makedirs(log_dir, exist_ok=True)
# logging.config.dictConfig(config)
logging.config.dictConfig(config)
logging.getLogger("redis_lock").setLevel(logging.WARNING)
logging.getLogger("urllib3").setLevel(logging.WARNING)
logging.getLogger("matplotlib.font_manager").setLevel(logging.WARNING)