Crate se_logger

Source
Expand description

§se-logger

Simple customizable logging crate.

§Getting started

use se_logger::*;
 
fn main() {
    // Initialize the logger with the log file path and log level
    // File path will be test_19_35_33.log (for example)
    log_init("test_%H_%M_%S.log", INFO);
     
    // Now you can use the library anywhere
    info("This is an info message");
    error("This is an error message");
}

Output:

[19:35:33] [INFO] [main] This is an info message
[19:35:33] [ERROR] [main] This is an error message

Constants§

DEBUG
ERROR
FATAL
INFO
TRACE
WARNING

Functions§

debug
Log a debug message
error
Log an error message
fatal
Log a fatal message
info
Log an info message
log
Log a generic message
log_init
Initialize the logger with settings
trace
Log a trace message
warning
Log a warning message