Created
August 8, 2018 03:59
-
-
Save ievans3024/8b6a6f6b69181a6f719b27ebdb5f7063 to your computer and use it in GitHub Desktop.
A function inspired by my verbosity.py gist for auto-configuring verbosity given an int and a logger.
This file contains hidden or 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 | |
LOG_LEVELS = [ | |
logging.CRITICAL, | |
logging.ERROR, | |
logging.WARNING, | |
logging.INFO, | |
logging.DEBUG | |
] | |
def get_verbosity(verbosity, levels=LOG_LEVELS): | |
return levels[verbosity] | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment