mirror of
https://github.com/lrnselfreliance/wrolpi.git
synced 2026-11-19 22:46:20 -05:00
13 lines
343 B
Python
13 lines
343 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 not message.strip():
|
|
return False
|
|
return True
|