1
0
Fork 0
forked from github/pelican

Don't suppress LOG_FILTER messages when --debug passed

This commit is contained in:
Alexander Turenko 2016-09-12 03:02:29 +03:00
commit 30b8955134
2 changed files with 8 additions and 6 deletions

View file

@ -112,12 +112,12 @@ class LimitFilter(logging.Filter):
else:
self._raised_messages.add(message_key)
# ignore LOG_FILTER records
# use .msg and not .getMessage() for string formatting to allow
# filtering by templates
ignore_key = (record.levelno, record.msg)
if ignore_key in self._ignore:
return False
# ignore LOG_FILTER records by templates when "debug" isn't enabled
logger_level = logging.getLogger().getEffectiveLevel()
if logger_level > logging.DEBUG:
ignore_key = (record.levelno, record.msg)
if ignore_key in self._ignore:
return False
# check if we went over threshold
if group: