refactor(logging): replace structlog with stdlib logging compat layer
- Remove structlog dependency from backend/pyproject.toml - Add app.utils.logging_compat shim for keyword-arg logging API - Add app.utils.json_formatter for JSON log output with extra fields - Update all backend modules to use logging_compat.get_logger() - Update docstrings in log_sanitizer.py and json_formatter.py - Update test comment in test_async_utils.py - Record 406 failing tests in Docs/Tasks.md for tracking
This commit is contained in:
@@ -24,7 +24,7 @@ from collections.abc import Mapping, Sequence, Set
|
||||
from pathlib import Path
|
||||
from typing import TYPE_CHECKING, Protocol
|
||||
|
||||
import structlog
|
||||
from app.utils.logging_compat import get_logger
|
||||
|
||||
from app.exceptions import Fail2BanConnectionError, Fail2BanProtocolError
|
||||
|
||||
@@ -68,7 +68,7 @@ type Fail2BanResponse = tuple[int, object]
|
||||
if TYPE_CHECKING:
|
||||
from types import TracebackType
|
||||
|
||||
log: structlog.stdlib.BoundLogger = structlog.get_logger()
|
||||
log = get_logger(__name__)
|
||||
|
||||
# Attempt to reuse the vendored fail2ban package embedded in the repository.
|
||||
# If it is not on sys.path yet, load it from ``../fail2ban-master``.
|
||||
|
||||
Reference in New Issue
Block a user