Skip to article frontmatterSkip to article content
Site not loading correctly?

This may be due to an incorrect BASE_URL configuration. See the MyST Documentation for reference.

logger

minto.logger

Logger module for Minto experiment tracking.

This module provides a unified logging interface for experiment and run operations with hierarchical output formatting.

Classes

MintoLogger

MintoLogger(config: typing.Optional = None)

Main logger class for Minto experiments and runs.

This class provides a unified interface for logging experiment and run activities with proper indentation and formatting.

Methods

log_experiment_start
log_experiment_start(experiment_name: str) -> None

Log the start of an experiment.

Parameters:

NameTypeDescription
experiment_namestrName of the experiment.
log_experiment_end
log_experiment_end(experiment_name: str, duration: float, run_count: int) -> None

Log the end of an experiment.

Parameters:

NameTypeDescription
experiment_namestrName of the experiment.
durationfloatTotal duration in seconds.
run_countintNumber of runs completed.
log_environment_info
log_environment_info(info: dict) -> None

Log environment information.

Parameters:

NameTypeDescription
infodictDictionary containing environment information.
log_run_start
log_run_start(run_id: int) -> None

Log the start of a run.

Parameters:

NameTypeDescription
run_idintID of the run.
log_run_end
log_run_end(run_id: int, duration: float) -> None

Log the end of a run.

Parameters:

NameTypeDescription
run_idintID of the run.
durationfloatDuration of the run in seconds.
log_parameter
log_parameter(name: str, value: typing.Any) -> None

Log a parameter setting.

Parameters:

NameTypeDescription
namestrParameter name.
valuetyping.AnyParameter value.
log_solution
log_solution(name: str, solution_info: str) -> None

Log a solution.

Parameters:

NameTypeDescription
namestrSolution name.
solution_infostrBrief description of the solution.
log_sampleset
log_sampleset(name: str, num_samples: int, min_energy: typing.Optional = None) -> None

Log a sampleset.

Parameters:

NameTypeDescription
namestrSampleset name.
num_samplesintNumber of samples.
min_energytyping.OptionalMinimum energy value (optional).
log_solver
log_solver(solver_name: str, execution_time: typing.Optional = None) -> None

Log solver execution.

Parameters:

NameTypeDescription
solver_namestrName of the solver.
execution_timetyping.OptionalExecution time in seconds (optional).
log_object
log_object(name: str, obj_type: str, size_info: str = '') -> None

Log an object.

Parameters:

NameTypeDescription
namestrObject name.
obj_typestrType of the object.
size_infostrAdditional size/content information.
log_warning
log_warning(message: str) -> None

Log a warning message.

Parameters:

NameTypeDescription
messagestrWarning message.
log_error
log_error(message: str) -> None

Log an error message.

Parameters:

NameTypeDescription
messagestrError message.
log_debug
log_debug(message: str) -> None

Log a debug message.

Parameters:

NameTypeDescription
messagestrDebug message.

Functions

get_logger

get_logger() -> minto.logger.MintoLogger

Get the global logger instance.

Returns:

TypeDescription
minto.logger.MintoLoggerThe global MintoLogger instance.

set_logger_config

set_logger_config(config: minto.logging_config.LogConfig) -> None

Set the configuration for the global logger.

Parameters:

NameTypeDescription
configminto.logging_config.LogConfigNew logging configuration.

configure_logging

configure_logging(enabled: bool = True, level: minto.logging_config.LogLevel = LogLevel.INFO, show_timestamps: bool = True, show_icons: bool = True, show_colors: bool = True) -> None

Configure logging with simplified parameters.

Parameters:

NameTypeDescription
enabledboolWhether to enable logging.
levelminto.logging_config.LogLevelMinimum log level to display.
show_timestampsboolWhether to show timestamps.
show_iconsboolWhether to show emoji icons.
show_colorsboolWhether to show colored output.