Skip to content

Commit

Permalink
initLogging: call disableLogging if already initialized and force_reinit
Browse files Browse the repository at this point in the history
  • Loading branch information
bertsky committed Nov 11, 2024
1 parent edaab4e commit 192895a
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/ocrd_utils/logging.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit 192895a

Please sign in to comment.