Skip to content

Commit

Permalink
Clear logging handler when initializing the logger
Browse files Browse the repository at this point in the history
  • Loading branch information
mtneug authored and lkiesow committed Jun 18, 2024
1 parent c63610f commit 8454b91
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions pyca/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,8 @@ def logger_init():
handlers.append(logging.StreamHandler(sys.stderr))
if logconf['file']:
handlers.append(logging.handlers.WatchedFileHandler(logconf['file']))
if logging.root.hasHandlers():
logging.root.handlers.clear()
for handler in handlers:
handler.setFormatter(logging.Formatter(logconf['format']))
logging.root.addHandler(handler)
Expand Down

0 comments on commit 8454b91

Please sign in to comment.