vis4d.common.logging

This module contains logging utility functions.

We provide utilities for setting up a logger and logging in a distributed setting.

Functions

dump_config(config, config_file)

Dump the configuration to a file.

rank_zero_debug(*args[, stacklevel])

Function used to log debug-level messages only on global rank 0.

rank_zero_info(*args[, stacklevel])

Function used to log info-level messages only on global rank 0.

rank_zero_warn(message[, stacklevel])

Function used to log warn-level messages only on global rank 0.

setup_logger(logger[, filepath, color, ...])

Configure logging for Vis4D.

dump_config(config, config_file)[source]

Dump the configuration to a file.

Parameters:
  • config (ExperimentConfig) – The configuration to dump.

  • config_file (str) – The path to the file to dump the configuration to.

Return type:

None

rank_zero_debug(*args, stacklevel=4, **kwargs)[source]

Function used to log debug-level messages only on global rank 0.

Return type:

None

rank_zero_info(*args, stacklevel=4, **kwargs)[source]

Function used to log info-level messages only on global rank 0.

Return type:

None

rank_zero_warn(message, stacklevel=4, **kwargs)[source]

Function used to log warn-level messages only on global rank 0.

Return type:

None

setup_logger(logger, filepath=None, color=True, std_out_level=20)[source]

Configure logging for Vis4D.

Parameters:
  • logger (logging.Logger) – The logger instance to be configured.

  • filepath (None | str, optional) – The filepath to the log file that stores the console output. Defaults to None.

  • color (bool, optional) – Whether to use a colored console output. Defaults to True.

  • std_out_level (int, optional) – Which logging level to output to the console. Defaults to logging.INFO. Note that all levels will be logged to file.

Return type:

None