Skip to content

Commit 474e13c

Browse files
fix: django http404 filter filtered too much django logging
1 parent 205a958 commit 474e13c

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

python_logging_filters/__init__.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,9 @@ class DjangoHttp404LogFilter(logging.Filter):
3333
PATTERN = re.compile("^Not Found:")
3434

3535
def filter(self, record: logging.LogRecord) -> bool:
36-
return (
36+
is_not_found_record = (
3737
self.PATTERN.fullmatch(record.msg) is not None
3838
and record.levelno == logging.WARNING
3939
and record.name.startswith("django")
4040
)
41+
return not is_not_found_record

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
setup(
44
name="python-logging-filters",
5-
version="0.1.3",
5+
version="0.1.4",
66
description="standard python logging filters",
77
long_description=open("README.md").read(),
88
long_description_content_type="text/markdown",

0 commit comments

Comments
 (0)