Skip to content

Commit

Permalink
fix: bug causing duplicate instantiations
Browse files Browse the repository at this point in the history
  • Loading branch information
jjjermiah committed Feb 25, 2024
1 parent 9b936fd commit 44d56b5
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/nbiatoolkit/logger/logger.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,9 @@ def setup_logger(
raise ValueError(f"Invalid log level: {log_level}")

# Create logger
if logging.getLogger(name).hasHandlers():
logging.getLogger(name).handlers.clear()

logger = logging.getLogger(name)
logger.setLevel(level)

Expand Down

0 comments on commit 44d56b5

Please sign in to comment.