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

@ -787,6 +787,8 @@ possible to unintentionally filter out multiple message types with the same
template (including messages from future Pelican versions). Proceed with template (including messages from future Pelican versions). Proceed with
caution. caution.
Note: This option does nothing ``--debug`` is passed.
.. _reading_only_modified_content: .. _reading_only_modified_content:

View file

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