Full Logger
Easy to use logger for Rust
Features
- Support few file formats.
- Console log.
- Message box using fltk.
- Support logs of Result and Option.
Formats
INI
Example
[error]
Y2023_M2_D21_H18_M59_S27_ML1677002367767 = Test
Y2023_M2_D21_H18_M59_S27_ML1677002367775 = RESULT_OK_"Test"
CSV
Example
2023-02-21 19:00:17.771215200 +01:00;error;Test;
2023-02-21 19:00:17.777826800 +01:00;error;RESULT_OK_"Test";
Getting-Started
- Manage Log Files
let working_dir = String from;
let max_file_size = Mo;
let file_manager = new;
// Get file path to a file under max_file_size (create one if necessary)
let file = file_manager.get_file_path;
// Allow console printing
set_allow_console_log;
// Setup simple logs
set_or_create_global_log_file;
- Set the file format
set_file_format;
- Time to Log
let path = vec!;
let message = "Test";
let mut error = Result:: Ok;
log;
error = log_result;
// Or you can use the simple way (must have defined a global file before)
simple_log;
error = simple_log_result;
- Enjoy
Here it's the result of a log calling log(file, path, message);
2023-02-21 19:00:17.771215200 +01:00;error;debug;Test;