Skip to content

Commit

Permalink
Fixed logging filter bug introduced in 1.4.4
Browse files Browse the repository at this point in the history
  • Loading branch information
Omar007 authored Sep 16, 2024
1 parent 695887b commit cc7a800
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 1 deletion.
2 changes: 1 addition & 1 deletion bazarr/app/logger.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ def filter(self, record):
# no filtering in debug mode or if originating from us
return True

if record.level != loggin.ERROR:
if record.level < logging.ERROR:
return False

unwantedMessages = [
Expand Down
22 changes: 22 additions & 0 deletions tests/test_logging_filters.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
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"
})
assert UnwantedWaitressMessageFilter().filter(record)

def test_false_below_error():
record = logging.makeLogRecord({
"level": logging.INFO
})
assert not UnwantedWaitressMessageFilter().filter(record)

def test_true_error_up():
record = logging.makeLogRecord({
"level": logging.CRITICAL
})
assert UnwantedWaitressMessageFilter().filter(record)

0 comments on commit cc7a800

Please sign in to comment.