Skip to content

Logging config

LoggingConfig #

LoggingConfig(**kwargs)

Bases: BaseModel

Holds the configuration for the logging process.

Attributes:

Name Type Description
level str

The logging level. Defaults to "WARNING".

log_file str | None

The logging file. Defaults to None.

format str

The logging format. Defaults to "%(asctime)s - %(name)s - %(levelname)s - %(message)s".

silent_mode bool

Whether to disable the prints and progress bars. Does NOT affect the logging. Defaults to False.

enable_otlp bool

Whether to enable OpenTelemetry trace logs. Defaults to True.

Source code in src/rapidata/rapidata_client/config/logging_config.py
def __init__(self, **kwargs):
    super().__init__(**kwargs)
    self._notify_handlers()

register_config_handler #

register_config_handler(
    handler: ConfigUpdateHandler,
) -> None

Register a handler to be called when the logging configuration updates.

Source code in src/rapidata/rapidata_client/config/logging_config.py
def register_config_handler(handler: ConfigUpdateHandler) -> None:
    """Register a handler to be called when the logging configuration updates."""
    _config_handlers.append(handler)

unregister_config_handler #

unregister_config_handler(
    handler: ConfigUpdateHandler,
) -> None

Unregister a previously registered handler.

Source code in src/rapidata/rapidata_client/config/logging_config.py
def unregister_config_handler(handler: ConfigUpdateHandler) -> None:
    """Unregister a previously registered handler."""
    if handler in _config_handlers:
        _config_handlers.remove(handler)