Function cgl_rs::logger::attach_log_file

source ·
pub fn attach_log_file(log_file_path: &str) -> bool
Expand description

Attaches a log file to the logger. If the log file already exists, it will be appended to, otherwise it will be created. Also note that there is a limit of 32 (may change in the future) log files that can be attached at the same time.

Arguments

  • log_file_path - A string slice containing the path to the log file.

Returns

A boolean value indicating whether the log file was successfully attached or not.

Example

cgl_rs::logger::init(true);
let log_file_path = "log.txt";
let attached = cgl_rs::logger::attach_log_file(log_file_path);
// ...
cgl_rs::logger::shutdown();