| 1 | use simple_logger::SimpleLogger; |
| 2 | use time::macros::format_description; |
| 3 | |
| 4 | fn main() { |
| 5 | SimpleLogger::new() |
| 6 | .env() |
| 7 | .with_timestamp_format(format_description!("[year]-[month]-[day] [hour]:[minute]:[second]")) |
| 8 | .init() |
| 9 | .unwrap(); |
| 10 | |
| 11 | log::warn!("This is an example message with custom timestamp format."); |
| 12 | } |