From 8972e43113700c6c6c912f2d2bda672f5b303a4b Mon Sep 17 00:00:00 2001 From: gabe Date: Sun, 9 Jan 2022 22:52:10 -0600 Subject: [PATCH] allowed setting the log level via command line. --- ASCIIsite.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/ASCIIsite.py b/ASCIIsite.py index be356fb..3277b64 100755 --- a/ASCIIsite.py +++ b/ASCIIsite.py @@ -14,8 +14,14 @@ def parse_arguments(): parser.add_argument('--exclude-file', type=Path, help='A text file containing glob patterns to exclude, 1 per line.') parser.add_argument('--exclude', nargs='+', help='A list of glob patterns to ignore. Remember to quote them so your shell doesnt escape them!') parser.add_argument('-z', '--compress', action='store_true', help='whether to compress the resulting directory to a tar.gz file. can be usefull for scripting to transfer the site to a remote server.') + parser.add_argument('-v', '--verbose', action='store_true', help='outputs debug messages onto the console.') args=parser.parse_args() + #setting log level + if args.verbose: + logging.info('setting log level to verbose') + logging.getLogger().setLevel(level=logging.DEBUG) + #set compress flag if args.output != None and not args.compress: #detect based on whether outFile has a .tar.gz filename.