Logger and LogLevel
- class composer.core.logging.logger.LogLevel(value)[source]
LogLevel denotes where in the training loop log messages are generated.
Logging destinations use the LogLevel to determine whether to record a given metric or state change
- class composer.core.logging.logger.Logger(state, log_destinations=())[source]
Logger records metrics and state changes to logging destinations.
It routes logging calls to the :class:`~compose.core.logging.base_backend.BaseLoggerBackend`s (specified in :param log_destinations:)
- Parameters
log_destinations (Sequence[BaseLoggerBackend]) – A sequence of :class:`~compose.core.logging.base_backend.BaseLoggerBackend`s to which logging calls will be sent.
- metric(log_level, data)[source]
Send :param data: with :param log_level: to the logging backends.
- Parameters
data (Union[TLogData, Callable[[], TLogData]]) – Can be either logging data or a callable that returns data to be logged. Callables will be invoked only when
will_log()
returns True for at least oneBaseLoggerBackend
. Useful when it is expensive to generate the data to be logged.
- Return type