python_structlog_config.presets

Preset configurations for different environments.

Per PRD specifications

Functions

configure_for_development(→ None)

Development preset - console output, debug level.

configure_for_production(→ None)

Production preset - JSON output, OTel, optional Sentry.

configure_for_testing(→ None)

Testing preset - minimal output, warning level.

Module Contents

python_structlog_config.presets.configure_for_development(service_name: str) None

Development preset - console output, debug level.

Args:

service_name: Service name for context

Example:
>>> configure_for_development("my-api")
python_structlog_config.presets.configure_for_production(service_name: str, sentry_dsn: str | None = None, log_level: str = 'INFO') None

Production preset - JSON output, OTel, optional Sentry.

Args:

service_name: Service name for context sentry_dsn: Sentry DSN (optional) log_level: Logging level (default: INFO)

Example:
>>> configure_for_production(
...     "my-api",
...     sentry_dsn="https://...@sentry.io/..."
... )
python_structlog_config.presets.configure_for_testing(service_name: str) None

Testing preset - minimal output, warning level.

Args:

service_name: Service name for context

Example:
>>> configure_for_testing("my-api")