From 020c9908def3a816e05984c3ee55457fc423a931 Mon Sep 17 00:00:00 2001 From: Matt Singleton Date: Sat, 22 Apr 2017 11:11:34 -0400 Subject: update command line arguments --- unbiased/main.py | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/unbiased/main.py b/unbiased/main.py index f81321e..caf77eb 100755 --- a/unbiased/main.py +++ b/unbiased/main.py @@ -48,11 +48,18 @@ logging_config = { def main(): parser = argparse.ArgumentParser() - parser.add_argument('-w', '--webroot', help='location of config file') - parser.add_argument('-l', '--log-dir', help='location to write logs') + parser.add_argument('webroot', help='location to write html output') + parser.add_argument('-l', '--log-dir', help='location to write detailed logs') + parser.add_argument('-d', '--debug', action='store_true', help='run in debug mode') args = parser.parse_args() - logging_config['handlers']['file']['filename'] = os.path.join(args.log_dir, 'unbiased.debug.log') + if args.log_dir: + logging_config['handlers']['file']['filename'] = os.path.join(args.log_dir, 'unbiased.debug.log') + else: + logging_config['loggers']['unbiased']['handlers'].remove('file') + del logging_config['handlers']['file'] + if args.debug: + logging_config['handlers']['console']['level'] = 'DEBUG' logging.config.dictConfig(logging_config) crawl_frequency = 600 -- cgit v1.2.3