Skip to content
femtologging
Menu

API reference

Records, formatters, and filters

Public declarations and behavioural boundaries for the prospective 0.2.0 surface.

0.2.0 surface · 0.2.0-beta1 forthcoming

The declarations below are transcribed from the public source and extension stubs at f5bcaa8. Ellipses mark defaults unspecified by the stub. Self denotes the same fluent builder type; _Any is the stub’s alias for typing.Any.

EXCEPTION_SCHEMA_VERSION

Exception payload schema version. Validate consumer compatibility before interpreting a structured exception.

View source declaration

LevelFilterBuilder

Fluent configuration for LevelFilter. Validate options and call build before registering output.

class LevelFilterBuilder:
    def __init__(self) -> None:
        ...
    def with_max_level(self, level: LevelArg) -> Self:
        ...
    def as_dict(self) -> dict[str, object]:
        ...
    def build(self) -> object:
        ...

View source declaration

NameFilterBuilder

Fluent configuration for NameFilter. Validate options and call build before registering output.

class NameFilterBuilder:
    def __init__(self) -> None:
        ...
    def with_prefix(self, prefix: str) -> Self:
        ...
    def as_dict(self) -> dict[str, object]:
        ...
    def build(self) -> object:
        ...

View source declaration

PythonCallbackFilterBuilder

Fluent configuration for PythonCallbackFilter. Validate options and call build before registering output.

class PythonCallbackFilterBuilder:
    def __init__(self, callback: object, /) -> None:
        ...
    def as_dict(self) -> dict[str, object]:
        ...

View source declaration

FormatterBuilder

Exported placeholder for named formatter registration. Handler IDs other than default are not connected; use callable formatters.

View source declaration

log_context

Thread-local scoped scalar fields. Inline extra wins on collision; avoid holding a scope across an await.

def log_context(**fields: object) -> cabc.Iterator[None]:
    ...

View source declaration

filter_frames

Filter structured stack frames using the supplied path patterns.

def filter_frames(payload: Mapping[str, _Any], *, exclude_filenames: list[str] | None=..., exclude_functions: list[str] | None=..., max_depth: int | None=..., exclude_logging: bool=...) -> dict[str, _Any]:
    ...

View source declaration

get_logging_infrastructure_patterns

Return patterns used to identify logging infrastructure frames.

def get_logging_infrastructure_patterns() -> list[str]:
    ...

View source declaration