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) -> NoneLog the start of an experiment.
Parameters:
| Name | Type | Description |
|---|---|---|
experiment_name | str | Name of the experiment. |
log_experiment_end¶
log_experiment_end(experiment_name: str, duration: float, run_count: int) -> NoneLog the end of an experiment.
Parameters:
| Name | Type | Description |
|---|---|---|
experiment_name | str | Name of the experiment. |
duration | float | Total duration in seconds. |
run_count | int | Number of runs completed. |
log_environment_info¶
log_environment_info(info: dict) -> NoneLog environment information.
Parameters:
| Name | Type | Description |
|---|---|---|
info | dict | Dictionary containing environment information. |
log_run_start¶
log_run_start(run_id: int) -> NoneLog the start of a run.
Parameters:
| Name | Type | Description |
|---|---|---|
run_id | int | ID of the run. |
log_run_end¶
log_run_end(run_id: int, duration: float) -> NoneLog the end of a run.
Parameters:
| Name | Type | Description |
|---|---|---|
run_id | int | ID of the run. |
duration | float | Duration of the run in seconds. |
log_parameter¶
log_parameter(name: str, value: typing.Any) -> NoneLog a parameter setting.
Parameters:
| Name | Type | Description |
|---|---|---|
name | str | Parameter name. |
value | typing.Any | Parameter value. |
log_solution¶
log_solution(name: str, solution_info: str) -> NoneLog a solution.
Parameters:
| Name | Type | Description |
|---|---|---|
name | str | Solution name. |
solution_info | str | Brief description of the solution. |
log_sampleset¶
log_sampleset(name: str, num_samples: int, min_energy: typing.Optional = None) -> NoneLog a sampleset.
Parameters:
| Name | Type | Description |
|---|---|---|
name | str | Sampleset name. |
num_samples | int | Number of samples. |
min_energy | typing.Optional | Minimum energy value (optional). |
log_solver¶
log_solver(solver_name: str, execution_time: typing.Optional = None) -> NoneLog solver execution.
Parameters:
| Name | Type | Description |
|---|---|---|
solver_name | str | Name of the solver. |
execution_time | typing.Optional | Execution time in seconds (optional). |
log_object¶
log_object(name: str, obj_type: str, size_info: str = '') -> NoneLog an object.
Parameters:
| Name | Type | Description |
|---|---|---|
name | str | Object name. |
obj_type | str | Type of the object. |
size_info | str | Additional size/content information. |
log_warning¶
log_warning(message: str) -> NoneLog a warning message.
Parameters:
| Name | Type | Description |
|---|---|---|
message | str | Warning message. |
log_error¶
log_error(message: str) -> NoneLog an error message.
Parameters:
| Name | Type | Description |
|---|---|---|
message | str | Error message. |
log_debug¶
log_debug(message: str) -> NoneLog a debug message.
Parameters:
| Name | Type | Description |
|---|---|---|
message | str | Debug message. |
Functions¶
get_logger¶
get_logger() -> minto.logger.MintoLoggerGet the global logger instance.
Returns:
| Type | Description |
|---|---|
minto.logger.MintoLogger | The global MintoLogger instance. |
set_logger_config¶
set_logger_config(config: minto.logging_config.LogConfig) -> NoneSet the configuration for the global logger.
Parameters:
| Name | Type | Description |
|---|---|---|
config | minto.logging_config.LogConfig | New 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) -> NoneConfigure logging with simplified parameters.
Parameters:
| Name | Type | Description |
|---|---|---|
enabled | bool | Whether to enable logging. |
level | minto.logging_config.LogLevel | Minimum log level to display. |
show_timestamps | bool | Whether to show timestamps. |
show_icons | bool | Whether to show emoji icons. |
show_colors | bool | Whether to show colored output. |