Logging: suprress sample/reference_tools and sample/spreadsheet success messages but keep failures. Should be disabled when debugging.

This commit is contained in:
2026-04-20 12:06:05 +02:00
parent 65e6e22e2d
commit 0bbe070776
+7 -1
View File
@@ -27,9 +27,15 @@ class QtLogHandler(logging.Handler):
class IgnoreSuccessfulStatusAccessFilter(logging.Filter):
#Should be disabled if debugging status calls.
#In particular if this is causing server/GUI lag
_SUPPRESSED_SUCCESS_MESSAGES = (
'"GET /status HTTP/1.1" 200',
'"GET /sample/reference_tools HTTP/1.1" 200',
'"GET /sample/spreadsheet HTTP/1.1" 200',
)
def filter(self, record: logging.LogRecord) -> bool:
message = record.getMessage()
return not ('"GET /status HTTP/1.1" 200' in message)
return not any(entry in message for entry in self._SUPPRESSED_SUCCESS_MESSAGES)
def get_uvicorn_logging_config() -> dict: