Created
October 9, 2015 07:53
-
-
Save Tjorriemorrie/5cc48b11539500299754 to your computer and use it in GitHub Desktop.
Python logging verbosity
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
parser.add_argument('-v', '--verbose', action='count', default=0) | |
parser.add_argument('-q', '--quiet', action='count', default=0) | |
logging_level = logging.WARN + 10*args.quiet - 10*args.verbose | |
# script -vv -> DEBUG | |
# script -v -> INFO | |
# script -> WARNING | |
# script -q -> ERROR | |
# script -qq -> CRITICAL | |
# script -qqq -> no logging at all |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment