feat: add structlog logging configuration

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-02-24 09:05:14 -06:00
parent a211f9b6bd
commit fb4b948681
2 changed files with 70 additions and 0 deletions

22
tests/test_logging.py Normal file
View File

@@ -0,0 +1,22 @@
"""Tests for structured logging configuration."""
import structlog
from app.logging_config import setup_logging
class TestLogging:
"""Tests for the structlog configuration."""
def test_setup_logging_configures_structlog(self) -> None:
"""setup_logging should configure structlog without errors."""
setup_logging(log_level="info")
logger = structlog.get_logger("test")
assert logger is not None
def test_logger_can_log_message(self) -> None:
"""A configured logger should be able to emit a log message."""
setup_logging(log_level="debug")
logger = structlog.get_logger("test_module")
# Should not raise
logger.info("test message", key="value")