feat: add structlog logging configuration
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
22
tests/test_logging.py
Normal file
22
tests/test_logging.py
Normal 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")
|
||||
Reference in New Issue
Block a user