Created
November 5, 2018 17:59
-
-
Save shawalli/2e930b35ef3254fd3309c390aebb3bff to your computer and use it in GitHub Desktop.
[PYTHON] Global Logging Level
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import logging | |
def initialize_logging(): | |
logging.basicConfig(level=logging.INFO) | |
def set_level(level): | |
logging.root.setLevel(level) | |
for logger in logging.Logger.manager.loggerDict.values(): | |
if not isinstance(logger, logging.PlaceHolder): | |
logger.setLevel(level) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment