Function init_logger

Source
pub fn init_logger(log_file: &str, enable: bool)
Expand description

Initializes the logger to write messages to console and the file.

The logger prints messages with a timestamp and log level (info!). Logging can be globally enabled or disabled using the LOGS_ENABLED flag in this class.

§Arguments

  • log_file - A string representing the path of the file where logs will be saved.

§Panics

This function will panic if the log file cannot be created or written.

§Example

// Initialize logger before generating solutions
init_logger("experiment.log");
info!("Logger initialized!");