From 906862e6d6ada1972a262c3074ae227ba7a228e9 Mon Sep 17 00:00:00 2001 From: jason Date: Wed, 10 Aug 2016 21:47:30 -0600 Subject: add a --debug flag for more output --- bin/dbolla | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/bin/dbolla b/bin/dbolla index 5148ae4..78fe482 100755 --- a/bin/dbolla +++ b/bin/dbolla @@ -9,7 +9,7 @@ from warmachine.config import Config from warmachine.connections.irc import AioIRC from warmachine.connections.slack import SlackWS -logging.config.dictConfig({ +log_config = { 'version': 1, 'disable_existing_loggers': False, @@ -35,7 +35,7 @@ logging.config.dictConfig({ 'handlers': ['console', ] } } -}) +} class Bot(object): @@ -118,6 +118,8 @@ if __name__ == "__main__": parser = argparse.ArgumentParser() parser.add_argument('-c', '--config', help='define warmachine config file', type=str) + parser.add_argument('--debug', help='enable extra logging output', + action='store_true', default=False) args = parser.parse_args() if args.config: @@ -126,6 +128,11 @@ if __name__ == "__main__": sys.stderr.write('Please specify a config file\n') sys.exit(1) + if args.debug: + log_config['loggers']['']['level'] = 'DEBUG' + + logging.config.dictConfig(log_config) + bot = Bot(settings) for s in settings.sections(): -- cgit v1.2.1