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
Currently both the MultiThreadedAugmenter and NonDetMultiThreadedAugmenter classes use the root logger to print logs to the console. Calling logging.debug() implicitly creates a new stream handler for the root logger. This is problematic in cases where the user is already using their own logger with its own stream handler. Messages are printed once by the user's logger, and then echoed by the root logger. The solution is simply to create a new logger for the batchgenerators package, and then use that logger to print relevant messages to stdout. For example a logger.py file could contain:
Then to print logs to stdout in other files such as multi_threaded_augmenter.py
fromloggerimportlogfromloggingimportINFO, DEBUG# Something happens in the codelog('A message about what happened')
log(INFO, 'This is an info message instead of default DEBUG message')
The text was updated successfully, but these errors were encountered:
Currently both the MultiThreadedAugmenter and NonDetMultiThreadedAugmenter classes use the root logger to print logs to the console. Calling logging.debug() implicitly creates a new stream handler for the root logger. This is problematic in cases where the user is already using their own logger with its own stream handler. Messages are printed once by the user's logger, and then echoed by the root logger. The solution is simply to create a new logger for the batchgenerators package, and then use that logger to print relevant messages to stdout. For example a logger.py file could contain:
Then to print logs to stdout in other files such as multi_threaded_augmenter.py
The text was updated successfully, but these errors were encountered: