Fixed logging filter bug introduced in 1.4.4

pull/2665/head v1.4.5-beta.0
Omar Pakker 2 months ago committed by GitHub
parent 695887b584
commit cc7a8000e7
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -62,7 +62,7 @@ class UnwantedWaitressMessageFilter(logging.Filter):
# no filtering in debug mode or if originating from us # no filtering in debug mode or if originating from us
return True return True
if record.level != loggin.ERROR: if record.level < logging.ERROR:
return False return False
unwantedMessages = [ unwantedMessages = [

@ -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)
Loading…
Cancel
Save