Skip to content

Instantly share code, notes, and snippets.

@driverdan
Created October 29, 2019 16:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save driverdan/4e5da1607cef3aba4633a3650dcd7bf2 to your computer and use it in GitHub Desktop.
Save driverdan/4e5da1607cef3aba4633a3650dcd7bf2 to your computer and use it in GitHub Desktop.
Runtime logging level change
# 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