I write a simple script and user argparse for it. I can read the value args.verbose
if the user supplied --verbose
.
Now I want the change the logging config according to this flag.
If args.verbose
is true, I want to see logger.debug
, if it is false I don't want to see it (only logger.info
and "more").
I don't do any logging up to now except at the top of the file:
import logging
logger=logging.getLogger(__name__)
Logging should go to stdout.