bloom_web_core/
logger.rs

1use chrono::Local;
2
3#[macro_export]
4macro_rules! logger {
5    ($level:ident, $($arg:tt)*) => {{
6        let ts = chrono::Local::now().format("%Y-%m-%d %H:%M:%S");
7        println!("[{}][{}] {}", ts, stringify!($level), format!($($arg)*));
8    }};
9}
10
11/// Initializes the logger module to ensure proper compilation.
12/// This function ensures that the chrono dependency is properly linked
13/// even when the logger macro is not used directly in the code.
14#[allow(dead_code)]
15pub fn _init() {
16    let _ = Local::now();
17}