- #handle -d
- if args.query_date:
- query_date = args.query_date
- else:
- yesterday = datetime.datetime.today() - datetime.timedelta(days=1)
- query_date = yesterday.strftime("%Y%m%d")
-
- #handle -L
- loglevel_mapping = { 'debug' : logging.DEBUG,
- 'info' : logging.INFO,
- 'warning' : logging.WARNING,
- 'error' : logging.ERROR,
- 'critical' : logging.CRITICAL }
-
- if args.logging_level in loglevel_mapping:
- loglevel = loglevel_mapping[args.logging_level]
- else:
- print("Choose a valid log level: debug, info, warning, error, or critical")
- exit