Created
October 29, 2019 16:49
-
-
Save driverdan/4e5da1607cef3aba4633a3650dcd7bf2 to your computer and use it in GitHub Desktop.
Runtime logging level change
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
# Source: https://stackoverflow.com/a/46710435 | |
import logging | |
# Set level to the logging level you want to use. | |
# This will typically be INFO or DEBUG. | |
level = logging.INFO | |
logger = logging.getLogger() | |
logger.setLevel(level) | |
for handler in logger.handlers: | |
handler.setLevel(level) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment