Skip to content

cayu.observability.logging

Public Cayu API. Definitions are grouped by their public source module, and definitions from private implementation modules appear on their package’s page; adding a symbol does not move existing links. The import shown at each entry is a supported public namespace. Read the Python API overview and install the required extra.

from cayu.observability import LoggingEventSink

Emit concise runtime event summaries through Python logging.

High-frequency streaming events (model.text.delta) log at TRACE_LEVEL (5) so DEBUG stays readable; set the logger to TRACE_LEVEL to see them.

The sink does not configure global handlers, process logging levels, or formatter state — the one exception being the non-clobbering, idempotent registration of the "TRACE" level name at import (skipped if the name or the level number is already taken). Applications stay responsible for logging configuration.

Bases: EventSink.

async LoggingEventSink.emit(event: Event) -> None
async LoggingEventSink.emit_timing(record: RuntimeTimingRecord) -> None
LoggingEventSink.__init__(*, logger: logging.Logger | None=None, logger_name: str=DEFAULT_CAYU_LOGGER_NAME, error_summary_limit: int=DEFAULT_ERROR_SUMMARY_LIMIT, redactor: SecretRedactor | None=None, log_runtime_timing: bool=False) -> None

Release source · Runtime guarantees · Capability guides

from cayu.observability import TRACE_LEVEL
TRACE_LEVEL = 5

Release source · Runtime guarantees · Capability guides