bloom-web-core 0.1.1

Core functionality for the Bloom web framework
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
use chrono::Local;

#[macro_export]
macro_rules! logger {
    ($level:ident, $($arg:tt)*) => {{
        let ts = chrono::Local::now().format("%Y-%m-%d %H:%M:%S");
        println!("[{}][{}] {}", ts, stringify!($level), format!($($arg)*));
    }};
}

/// Initializes the logger module to ensure proper compilation.
/// This function ensures that the chrono dependency is properly linked
/// even when the logger macro is not used directly in the code.
#[allow(dead_code)]
pub fn _init() {
    let _ = Local::now();
}