diff --git a/app/config.py b/app/config.py index f8b21d0..1d8ee5a 100644 --- a/app/config.py +++ b/app/config.py @@ -20,7 +20,7 @@ class Config(object): ERRORS_TO = ['kae@midnighthax.com'] FADE_STEPS = 20 FADE_TIME = 3000 - LOG_LEVEL_STDERR = logging.DEBUG + LOG_LEVEL_STDERR = logging.INFO LOG_LEVEL_SYSLOG = logging.DEBUG LOG_NAME = "musicmuster" MAIL_PASSWORD = os.environ.get('MAIL_PASSWORD') diff --git a/app/log.py b/app/log.py index 510cf55..8fcb1a9 100644 --- a/app/log.py +++ b/app/log.py @@ -59,8 +59,20 @@ def log_uncaught_exceptions(ex_cls, ex, tb): sys.excepthook = log_uncaught_exceptions -def DEBUG(msg): - log.debug(msg) +def DEBUG(msg, force_stderr=False): + """ + Outupt a log message at level DEBUG. If force_stderr is True, + output this message to stderr regardless of default stderr level + setting. + """ + + if force_stderr: + old_level = stderr.level + stderr.setLevel(logging.DEBUG) + log.debug(msg) + stderr.setLevel(old_level) + else: + log.debug(msg) def EXCEPTION(msg):