You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Child loggers propagate messages up to the handlers associated with their ancestor loggers. Because of this, it is unnecessary to define and configure handlers for all the loggers an application uses. It is sufficient to configure handlers for a top-level logger and create child loggers as needed. (You can, however, turn off propagation by setting the propagate attribute of a logger to False.)
This code shows the problem of propagation to ancestor
# no ancestor so print is oklogger=setup_logger("logger")
logger.info("message 1 from test logger")
# logging creates root ancestor of all loggers including one above logging.info("message from default logging, a root logger is defined !")
# root + logger dump...logger.info("message 2 from test logger")
Result is
> 2020-05-05 09:24:27,583 logger INFO: message 1 from test logger
> 2020-05-05 09:24:27,583 logger INFO: message 2 from test logger
> INFO:logger:message 2 from test logger
Environment
PyTorch Version (e.g., 1.4): 1.5
Ignite Version (e.g., 0.3.0): 0.4
OS (e.g., Linux): Linux
How you installed Ignite (conda, pip, source): conda
Python version: 3.7
Any other relevant information:
The text was updated successfully, but these errors were encountered:
🐛 Bug description
This bug is related to logger from module logging. Actually, (logging) handlers are attached to loggers created by user.
ignite/ignite/utils.py
Lines 64 to 137 in bef668c
From
logging
documentation (https://docs.python.org/3/howto/logging.html#loggers)This code shows the problem of propagation to ancestor
Result is
Environment
conda
,pip
, source): condaThe text was updated successfully, but these errors were encountered: