Download:
child 27:a5f866114e79
parent 25:2dd502d4e9df
26:a24aee2294c6
Anton Shestakov <av6@dwimlabs.net>, Mon, 18 Jul 2016 19:16:00 +0800
rollbot: move logging below the lookups, split the line Helps keeping options and their defaults closer.

1 файлов изменено, 4 вставок(+), 3 удалений(-) [+]
rollbot.py file | annotate | diff | comparison | revisions
--- a/rollbot.py Mon Jul 18 19:12:06 2016 +0800
+++ b/rollbot.py Mon Jul 18 19:16:00 2016 +0800
@@ -243,9 +243,6 @@
group.add_argument('-d', '--debug', help='set logging to DEBUG', const=logging.DEBUG, **extra)
args = parser.parse_args()
-
- logging.basicConfig(level=args.loglevel, format='%(asctime)s %(levelname)-8s %(message)s')
-
config = yaml.safe_load(args.config) if hasattr(args, 'config') else {}
jid = lookup('jid', args, config)
@@ -253,6 +250,10 @@
nick = lookup('nick', args, config, default='rollbot')
prefix = lookup('prefix', args, config, default='!')
+ logging.basicConfig(
+ level=args.loglevel,
+ format='%(asctime)s %(levelname)-8s %(message)s')
+
rollbot = RollBot(jid, password, nick, prefix)
rollbot.auto_authorize = True
rollbot.auto_subscribe = True