1
2
3
4
5
6
7
8
9
10
11
12
use simple_logger::SimpleLogger;
use time::macros::format_description;

fn main() {
    SimpleLogger::new()
        .env()
        .with_timestamp_format(format_description!("[year]-[month]-[day] [hour]:[minute]:[second]"))
        .init()
        .unwrap();

    log::warn!("This is an example message with custom timestamp format.");
}