diff options
author | morpheus65535 <[email protected]> | 2024-09-20 07:42:16 -0400 |
---|---|---|
committer | morpheus65535 <[email protected]> | 2024-09-20 07:42:16 -0400 |
commit | 90b44802dc3be1429b5d41eb4ad4603c80f1ce80 (patch) | |
tree | 87ef02d776b768eb8f1d7e1a0a9494e9ac31c014 | |
parent | cc7a8000e74c09ac2a747cf303ff86a48f37ec1e (diff) | |
download | bazarr-90b44802dc3be1429b5d41eb4ad4603c80f1ce80.tar.gz bazarr-90b44802dc3be1429b5d41eb4ad4603c80f1ce80.zip |
Fixed logging filter issue.
-rw-r--r-- | bazarr/app/logger.py | 2 | ||||
-rw-r--r-- | tests/bazarr/test_logging_filters.py (renamed from tests/test_logging_filters.py) | 13 |
2 files changed, 4 insertions, 11 deletions
diff --git a/bazarr/app/logger.py b/bazarr/app/logger.py index e5f2fce7d..8762d0355 100644 --- a/bazarr/app/logger.py +++ b/bazarr/app/logger.py @@ -62,7 +62,7 @@ class UnwantedWaitressMessageFilter(logging.Filter): # no filtering in debug mode or if originating from us return True - if record.level < logging.ERROR: + if record.levelno < logging.ERROR: return False unwantedMessages = [ diff --git a/tests/test_logging_filters.py b/tests/bazarr/test_logging_filters.py index 9209fb09e..05d655477 100644 --- a/tests/test_logging_filters.py +++ b/tests/bazarr/test_logging_filters.py @@ -3,20 +3,13 @@ import logging from bazarr.app.logger import UnwantedWaitressMessageFilter def test_true_for_bazarr(): - record = logging.makeLogRecord({ - "level": logging.INFO, - "msg": "a message from BAZARR for logging" - }) + record = logging.LogRecord("", logging.INFO, "", 0, "a message from BAZARR for logging", (), None) assert UnwantedWaitressMessageFilter().filter(record) def test_false_below_error(): - record = logging.makeLogRecord({ - "level": logging.INFO - }) + record = logging.LogRecord("", logging.INFO, "", 0, "", (), None) assert not UnwantedWaitressMessageFilter().filter(record) def test_true_error_up(): - record = logging.makeLogRecord({ - "level": logging.CRITICAL - }) + record = logging.LogRecord("", logging.CRITICAL, "", 0, "", (), None) assert UnwantedWaitressMessageFilter().filter(record) |