Skip to content

katana_public_api_client._logging

katana_public_api_client._logging

Logger protocol for duck-typed logger compatibility.

Defines a minimal Protocol that both logging.Logger and structlog's BoundLogger satisfy, so consumers can pass their already-configured logger directly without adapters.

The public Logger type alias is a Union of logging.Logger (for nominal compatibility with the ty type checker) and _LoggerProtocol (for structural compatibility with duck-typed loggers like structlog).

Attributes

Logger = logging.Logger | _LoggerProtocol module-attribute

Type alias accepted everywhere the client takes a logger parameter.

Both logging.Logger and any duck-typed logger (e.g. structlog's BoundLogger) satisfying :class:_LoggerProtocol are accepted.