1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
//! Simple logger to make debugging the optimizer simpler. Can be enabled using a flag.

#[cfg(feature = "log_optimizer")]
pub const LOG_ENABLED: bool = true;
#[cfg(not(feature = "log_optimizer"))]
pub const LOG_ENABLED: bool = false;

#[macro_export]
macro_rules! log {
    ($($args:tt)*) => {
        if $crate::opt::logger::LOG_ENABLED {
            print!("{}:{}:{} ", file!(), line!(), column!());
            println!($($args)*);
        }
    };
}