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
The root logger setup in the version check interferes with the custom logging structure. For example, let's assume that I'm making my own Python package where a top-level logger is setup in the init.py of the package, and loggers in the sub-packages inherit from this top-level logger. The top-level logger adds a stream handler. If Albumentations is imported somewhere in the package it will override/setup the root logger with a different stream handler and all the loggers will log twice.
Please do not use the BasicConfig() function and instead manually add the handler to your logger.
If anybody has the same issue, the workaround is to always check and remove handlers from the root logger (you are most likely not using the root logger anyway) when creating a new logger:
for handler in logging.root.handlers[:]:
logging.root.removeHandler(handler)
The text was updated successfully, but these errors were encountered:
The root logger setup in the version check interferes with the custom logging structure. For example, let's assume that I'm making my own Python package where a top-level logger is setup in the init.py of the package, and loggers in the sub-packages inherit from this top-level logger. The top-level logger adds a stream handler. If Albumentations is imported somewhere in the package it will override/setup the root logger with a different stream handler and all the loggers will log twice.
Please do not use the
BasicConfig()
function and instead manually add the handler to your logger.This is the line in question
If anybody has the same issue, the workaround is to always check and remove handlers from the root logger (you are most likely not using the root logger anyway) when creating a new logger:
The text was updated successfully, but these errors were encountered: