Skip to content

Commit

Permalink
Merge pull request #25 from sot/issue-24
Browse files Browse the repository at this point in the history
bugfix: do not configure logger if it has a handler or log-level is set
  • Loading branch information
taldcroft authored Aug 31, 2022
2 parents f84c044 + 79de3af commit 741dd3f
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions ska_helpers/logging.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,9 @@ def basic_logger(name, format="%(asctime)s %(funcName)s: %(message)s", **kwargs)
kwargs['format'] = format
logger = logging.getLogger(name)

if not kwargs.get('force', False) and (logger.hasHandlers() or logger.level != logging.NOTSET):
return logger

# Monkeypatch logging temporarily and configure our logger
root = logging.root
try:
Expand Down

0 comments on commit 741dd3f

Please sign in to comment.