Skip to content

academy.logging.configs.multi

MultiLogging

MultiLogging(configs: list[LogConfig])

Bases: LogConfig

This captures a collection of other LogConfigs.

The configurations can be (de)initialized and moved around a distributed system all together.

Source code in academy/logging/configs/multi.py
def __init__(
    self,
    configs: list[LogConfig],
) -> None:
    super().__init__()
    self._configs = configs

init_logging

init_logging() -> Callable[[], None]

Initializes logging for all of the supplied configs.

Source code in academy/logging/configs/multi.py
def init_logging(self) -> Callable[[], None]:
    """Initializes logging for all of the supplied configs."""
    uninits = [c.init_logging() for c in self._configs]

    def uninit_callback() -> None:
        for uninit in uninits:
            assert callable(uninit)
            uninit()

    return uninit_callback