log level controlled by DEBUG
This commit is contained in:
parent
284a3fa029
commit
dfa910a642
3 changed files with 5 additions and 9 deletions
|
@ -24,6 +24,7 @@ def get_conf(prefix='LARIGIRA_'):
|
|||
conf['MPD_WAIT_START'] = True
|
||||
conf['MPD_WAIT_START_RETRYSECS'] = 5
|
||||
conf['CHECK_SECS'] = 20
|
||||
conf['DEBUG'] = False
|
||||
conf.update(from_envvars(prefix=prefix))
|
||||
return conf
|
||||
|
||||
|
|
|
@ -2,10 +2,6 @@ from __future__ import print_function
|
|||
from gevent import monkey
|
||||
monkey.patch_all(subprocess=True)
|
||||
import logging
|
||||
FORMAT = '%(asctime)s|%(levelname)s[%(name)s:%(lineno)d] %(message)s'
|
||||
logging.basicConfig(level=logging.INFO,
|
||||
format=FORMAT,
|
||||
datefmt='%H:%M:%S')
|
||||
logging.getLogger('mpd').setLevel(logging.WARNING)
|
||||
from datetime import datetime, timedelta
|
||||
|
||||
|
|
|
@ -11,10 +11,6 @@ import tempfile
|
|||
import signal
|
||||
from time import sleep
|
||||
import logging
|
||||
FORMAT = '%(asctime)s|%(levelname)s[%(name)s:%(lineno)d] %(message)s'
|
||||
logging.basicConfig(level=logging.INFO,
|
||||
format=FORMAT,
|
||||
datefmt='%H:%M:%S')
|
||||
|
||||
import gevent
|
||||
from gevent.wsgi import WSGIServer
|
||||
|
@ -52,7 +48,10 @@ class Larigira(object):
|
|||
|
||||
def main():
|
||||
os.environ['TMPDIR'] = tempfile.mkdtemp(prefix='larigira')
|
||||
logging.basicConfig(level=logging.DEBUG)
|
||||
log_format = '%(asctime)s|%(levelname)s[%(name)s:%(lineno)d] %(message)s'
|
||||
logging.basicConfig(level=logging.DEBUG if get_conf()['DEBUG'] else logging.INFO,
|
||||
format=log_format,
|
||||
datefmt='%H:%M:%S')
|
||||
if(get_conf()['MPD_WAIT_START']):
|
||||
while True:
|
||||
try:
|
||||
|
|
Loading…
Reference in a new issue