refactor: enhance logging and error handling in API endpoints and HTTP server

This commit is contained in:
Lloyd
2026-06-25 21:26:29 +01:00
parent 1a6e09f63d
commit 42cd75e6b0
5 changed files with 54 additions and 2 deletions
+4 -1
View File
@@ -94,7 +94,10 @@ class LogBuffer(logging.Handler):
}
if record.exc_info:
entry["exception"] = self.formatException(record.exc_info)
formatter = self.formatter or logging.Formatter()
entry["exception"] = self._sanitize_log_text(
formatter.formatException(record.exc_info)
)
with self._lock:
self.logs.append(entry)