From 192895afd5c38314e9a7de59b866b8bfedf1f523 Mon Sep 17 00:00:00 2001 From: Robert Sachunsky Date: Mon, 11 Nov 2024 13:34:10 +0000 Subject: [PATCH] initLogging: call disableLogging if already initialized and force_reinit --- src/ocrd_utils/logging.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/ocrd_utils/logging.py b/src/ocrd_utils/logging.py index c56c1401f..addd1cfca 100644 --- a/src/ocrd_utils/logging.py +++ b/src/ocrd_utils/logging.py @@ -152,8 +152,11 @@ def initLogging(builtin_only=False, force_reinit=False, silent=not config.OCRD_L - silent (bool, True): Whether to log logging behavior by printing to stderr """ global _initialized_flag - if _initialized_flag and not force_reinit: - return + if _initialized_flag: + if force_reinit: + disableLogging(silent=silent) + else: + return config_file = None if not builtin_only: