Make more readable

This commit is contained in:
Miroslav Kovar 2019-10-02 09:58:11 +02:00 committed by Lex Berezhny
parent 75fac93544
commit 63447d1ec3

View file

@ -242,11 +242,14 @@ def run_daemon(args: list, conf: Config):
loop = asyncio.get_event_loop() loop = asyncio.get_event_loop()
log.setLevel(logging.DEBUG if args.verbose == [] else logging.INFO) log.setLevel(logging.INFO)
for module in args.verbose or []: if args.verbose is not None:
logging.getLogger(module).setLevel(logging.DEBUG)
if isinstance(args.verbose, list):
loop.set_debug(True) loop.set_debug(True)
if len(args.verbose) > 0:
for module in args.verbose:
logging.getLogger(module).setLevel(logging.DEBUG)
else:
log.setLevel(logging.DEBUG)
if conf.share_usage_data: if conf.share_usage_data:
loggly_handler = get_loggly_handler() loggly_handler = get_loggly_handler()