Allow setting of log level via WUBLOADER_LOG_LEVEL env var

By using an env var, it is universal and happens prior to arg parsing,
at the same point we do other logging setup.
pull/20/head^2
Mike Lang 6 years ago committed by Christopher Usher
parent c0357680cf
commit 17972b87aa

@ -3,6 +3,7 @@ import gevent.monkey
gevent.monkey.patch_all() gevent.monkey.patch_all()
import logging import logging
import os
import argh import argh
@ -10,5 +11,6 @@ from downloader.main import main
LOG_FORMAT = "[%(asctime)s] %(levelname)8s %(name)s(%(module)s:%(lineno)d): %(message)s" LOG_FORMAT = "[%(asctime)s] %(levelname)8s %(name)s(%(module)s:%(lineno)d): %(message)s"
logging.basicConfig(level=logging.INFO, format=LOG_FORMAT) level = os.environ.get('WUBLOADER_LOG_LEVEL', 'INFO').upper()
logging.basicConfig(level=level, format=LOG_FORMAT)
argh.dispatch_command(main) argh.dispatch_command(main)

@ -3,6 +3,7 @@ import gevent.monkey
gevent.monkey.patch_all() gevent.monkey.patch_all()
import logging import logging
import os
import argh import argh
@ -10,5 +11,6 @@ from restreamer.main import main
LOG_FORMAT = "[%(asctime)s] %(levelname)8s %(name)s(%(module)s:%(lineno)d): %(message)s" LOG_FORMAT = "[%(asctime)s] %(levelname)8s %(name)s(%(module)s:%(lineno)d): %(message)s"
logging.basicConfig(level=logging.INFO, format=LOG_FORMAT) level = os.environ.get('WUBLOADER_LOG_LEVEL', 'INFO').upper()
logging.basicConfig(level=level, format=LOG_FORMAT)
argh.dispatch_command(main) argh.dispatch_command(main)

Loading…
Cancel
Save