mirror of
https://github.com/lrnselfreliance/wrolpi.git
synced 2026-10-26 19:01:39 -04:00
13 lines
372 B
Python
13 lines
372 B
Python
import logging
|
|
|
|
|
|
class EmptyMessageFilter(logging.Filter):
|
|
"""Used to filter empty messages that Sanic's access log emits."""
|
|
|
|
def filter(self, record: logging.LogRecord) -> bool:
|
|
message = record.msg
|
|
if not message:
|
|
return False
|
|
if isinstance(message, str) and not message.strip():
|
|
return False
|
|
return True
|