From 7b9e216639a5fe76396b773ad3b7ffee36e13c4b Mon Sep 17 00:00:00 2001 From: javex Date: Wed, 27 Sep 2023 18:37:03 +0930 Subject: [PATCH] Add option for debug logging --- main.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/main.py b/main.py index 72c6bf5..a214ea5 100644 --- a/main.py +++ b/main.py @@ -1,12 +1,20 @@ from hotprices_au import woolies, coles import argparse +import logging def main(): parser = argparse.ArgumentParser() parser.add_argument('--quick', action='store_true', default=False) + parser.add_argument('--debug', action='store_true', default=False) parser.add_argument('store', choices=['woolies', 'coles']) args = parser.parse_args() + + if args.debug: + logging.basicConfig(level=logging.DEBUG) + else: + logging.basicConfig(level=logging.INFO) + match args.store: case 'woolies': woolies.main(args.quick)