Skip to content

Commit

Permalink
disable propagation of loggers to ancestrors (#1013)
Browse files Browse the repository at this point in the history
Co-authored-by: Desroziers <sylvain.desroziers@ifpen.fr>
  • Loading branch information
sdesrozis and Desroziers committed May 5, 2020
1 parent bef668c commit 1eddc71
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions ignite/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,12 @@ def setup_logger(
"""
logger = logging.getLogger(name)

# don't propagate to ancestors
# the problem here is to attach handlers to loggers
# should we provide a default configuration less open ?
if name is not None:
logger.propagate = False

# Remove previous handlers
if logger.hasHandlers():
for h in list(logger.handlers):
Expand Down

0 comments on commit 1eddc71

Please sign in to comment.