log::log! [-]  [+] [src]

macro_rules! log {
    ($lvl:expr, $($arg:tt)+) => ({
        static LOC: $crate::LogLocation = $crate::LogLocation {
            line: line!(),
            file: file!(),
            module_path: module_path!(),
        };
        let lvl = $lvl;
        if !cfg!(log_level = "off") &&
                (lvl <= $crate::LogLevel::Error || !cfg!(log_level = "error")) &&
                (lvl <= $crate::LogLevel::Warn || !cfg!(log_level = "warn")) &&
                (lvl <= $crate::LogLevel::Debug || !cfg!(log_level = "debug")) &&
                (lvl <= $crate::LogLevel::Info || !cfg!(log_level = "info")) &&
                lvl <= $crate::max_log_level() {
            $crate::log(lvl, &LOC, format_args!($($arg)+))
        }
    })
}

The standard logging macro.

This macro will generically log with the specified LogLevel and format! based argument list.

The log_level cfg can be used to statically disable logging at various levels.