Skip to content
femtologging
Menu

API reference

Loggers and routing

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.

FemtoLogger

Named routing, producer-side validation, bounded dispatch, and drop accounting. Logging returns a formatted string or None; it is not a delivery acknowledgement.

class FemtoLogger:
    def __init__(self, name: str) -> None:
        ...
    @property
    def parent(self) -> str | None:
        ...
    @property
    def level(self) -> str:
        ...
    @property
    def propagate(self) -> bool:
        ...
    def log(self, level: LevelArg, message: str, /, *, exc_info: ExcInfo=None, stack_info: bool=False, extra: StructuredFields | None=None) -> str | None:
        ...
    def set_level(self, level: LevelArg) -> None:
        ...
    def set_propagate(self, flag: bool) -> None:
        ...
    def add_handler(self, handler: object) -> None:
        ...
    def remove_handler(self, handler: object) -> bool:
        ...
    def clear_handlers(self) -> None:
        ...
    def clear_filters(self) -> None:
        ...
    def get_dropped(self) -> int:
        ...
    def flush_handlers(self) -> bool:
        ...
    def isEnabledFor(self, level: LevelArg) -> bool:
        ...
    def debug(self, message: str, /, *, exc_info: ExcInfo=None, stack_info: bool=False, extra: StructuredFields | None=None) -> str | None:
        ...
    def info(self, message: str, /, *, exc_info: ExcInfo=None, stack_info: bool=False, extra: StructuredFields | None=None) -> str | None:
        ...
    def warning(self, message: str, /, *, exc_info: ExcInfo=None, stack_info: bool=False, extra: StructuredFields | None=None) -> str | None:
        ...
    def error(self, message: str, /, *, exc_info: ExcInfo=None, stack_info: bool=False, extra: StructuredFields | None=None) -> str | None:
        ...
    def critical(self, message: str, /, *, exc_info: ExcInfo=None, stack_info: bool=False, extra: StructuredFields | None=None) -> str | None:
        ...
    def exception(self, message: str, /, *, exc_info: ExcInfo=True, stack_info: bool=False) -> str | None:
        ...

View source declaration

get_logger

Return the registered singleton for a valid dotted name. Empty or malformed names fail validation.

View source declaration

getLogger

Compatibility alias for get_logger. It uses the femtologging manager.

View source declaration

debug

Module-level convenience logging through the root. For per-component ownership, prefer a named logger.

View source declaration

info

Module-level convenience logging through the root. For per-component ownership, prefer a named logger.

View source declaration

warn

Module-level convenience logging through the root. For per-component ownership, prefer a named logger.

View source declaration

error

Module-level convenience logging through the root. For per-component ownership, prefer a named logger.

View source declaration