Skip to content

Instantly share code, notes, and snippets.

@sidharthshah
Created October 8, 2015 06:56
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sidharthshah/edb23e71af8866accac6 to your computer and use it in GitHub Desktop.
Save sidharthshah/edb23e71af8866accac6 to your computer and use it in GitHub Desktop.
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