ooai_llm.logging

Logging helpers for ooai_llm.

Purpose:

Provide one small logging facade that prefers ultilog when installed and falls back to standard-library logging when the optional dependency is absent.

Attributes

Functions

configure_logging(→ Any)

Configure application logging.

get_logger(→ logging.Logger)

Return a logger from ultilog when available, else stdlib logging.

logging_context(→ collections.abc.Iterator[None])

Bind contextual logging fields when ultilog supports it.

log_event(→ None)

Emit a structured-ish log event without assuming a specific backend.

Module Contents

ooai_llm.logging.LoggingPreset[source]
ooai_llm.logging.LoggingMode[source]
ooai_llm.logging.configure_logging(*, preset: LoggingPreset | None = None, level: str | int | None = None, mode: LoggingMode | None = None, force: bool = False, service_name: str | None = None, **kwargs: Any) Any[source]

Configure application logging.

When ultilog is installed, this delegates to ultilog.setup(...). Otherwise it configures standard-library logging with basicConfig.

ooai_llm.logging.get_logger(name: str | None = None) logging.Logger[source]

Return a logger from ultilog when available, else stdlib logging.

ooai_llm.logging.logging_context(**fields: Any) collections.abc.Iterator[None][source]

Bind contextual logging fields when ultilog supports it.

ooai_llm.logging.log_event(logger: logging.Logger, event: str, *, level: str = 'debug', **fields: Any) None[source]

Emit a structured-ish log event without assuming a specific backend.