Skip to content

Instantly share code, notes, and snippets.

@ievans3024
Created August 8, 2018 03:59
Show Gist options
  • Save ievans3024/8b6a6f6b69181a6f719b27ebdb5f7063 to your computer and use it in GitHub Desktop.
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.
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