tardis.io.logger.logger module

class tardis.io.logger.logger.LogFilter(log_levels)[source]

Bases: object

Filter for controlling which log levels are displayed.

Parameters:
log_levelslist

List of logging levels to allow through the filter.

filter(log_record)[source]

Determine if a log record should be displayed.

Parameters:
log_recordlogging.LogRecord

The log record to evaluate.

Returns:
bool

True if the record’s level is in the allowed levels, False otherwise.

class tardis.io.logger.logger.LoggingConfig(LEVELS: dict = <factory>, COLORS: dict = <factory>)[source]

Bases: object

Logging configuration.

Attributes:
LEVELSdict

The logging levels.

COLORSdict

The logging colors.

DEFAULT_LEVELstr

The default logging level.

DEFAULT_SPECIFIC_STATEbool

The default specific log level state.

COLORS: dict
DEFAULT_LEVEL = 'INFO'
DEFAULT_SPECIFIC_STATE = False
LEVELS: dict
class tardis.io.logger.logger.TARDISLogger(log_columns=None, display_handles=None, batch_size=10)[source]

Bases: object

Main logger class for TARDIS.

Parameters:
log_columnsdict

Dictionary of scroll columns for each log level.

display_handlesdict, optional

Dictionary of display handles for each column (jupyter environment).

configure_logging(log_level, tardis_config, specific_log_level=None)[source]

Configure the logging level and filtering for TARDIS loggers.

Parameters:
log_levelstr

The logging level to use (e.g., “INFO”, “DEBUG”).

tardis_configdict

Configuration dictionary containing debug settings.

specific_log_levelbool, optional

Whether to enable specific log level filtering.

Raises:
ValueError

If an invalid log_level is provided.

finalize_widget_logging()[source]

Finalize widget logging by embedding the final state.

remove_widget_handler()[source]

Remove the widget handler from the logger.

setup_stream_handler()[source]

Set up notebook-based logging after widget handler is removed.

setup_widget_logging(display_widget=True)[source]

Set up widget-based logging interface.

Parameters:
display_widgetbool, optional

Whether to display the widget in GUI environments. Default is True.

tardis.io.logger.logger.logging_state(log_level, tardis_config, specific_log_level=None, display_logging_widget=True, widget_start_height=10, widget_max_height=300, batch_size=10)[source]

Configure and initialize the TARDIS logging system.

Parameters:
log_levelstr

The logging level to use (e.g., “INFO”, “DEBUG”).

tardis_configdict

Configuration dictionary containing debug settings.

specific_log_levelbool, optional

Whether to enable specific log level filtering.

display_logging_widgetbool, optional

Whether to display the logging widget. Default is True.

widget_start_heightint, optional

Starting height for widget columns. Default is 10.

widget_max_heightint, optional

Maximum height for widget columns. Default is 300.

batch_sizeint, optional

Number of logs to batch before updating widget. Default is 10.

Returns:
dict

Dictionary of log columns if display_logging_widget is True, otherwise None.