s365b.core.logging

Structured logging setup.

All processes log through structlog. In containers the output is one JSON object per line on stdout, which docker logs and log shippers read directly.

Functions

configure_logging([level, fmt]) → None

Configure structlog and the standard library logger.

get_logger([name]) → structlog.typing.FilteringBoundLogger

Return a structlog logger.

Module Contents

s365b.core.logging.configure_logging(level: str = 'INFO', fmt: str = 'json') → None[source]

Configure structlog and the standard library logger.

Parameters:
  • level – Minimum level name, e.g. "INFO".

  • fmt – "json" for machine-readable output, "console" for human-friendly output during development.

s365b.core.logging.get_logger(name: str | None = None) → structlog.typing.FilteringBoundLogger[source]

Return a structlog logger.

Parameters:

name – Optional logger name, bound as the logger field.

Returns:

A bound structlog logger.