1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
#[cfg(any(all(debug_assertions, feature = "level_error_off"), all(not(debug_assertions), feature = "release_level_error_off") ) )]
#[macro_export]
///Writes error log
macro_rules! error {
    ($($arg:tt)*) => {
    }
}

#[cfg(any(all(debug_assertions, not(feature = "level_error_off")), all(not(debug_assertions), not(feature = "release_level_error_off")) ) )]
#[macro_export]
///Writes error log
macro_rules! error {
    ($($arg:tt)*) => {
        if $crate::is_enabled($crate::Level::ERROR) {
            use core::fmt::Write;
            let _ = core::writeln!($crate::Out::error(core::concat!("- [", core::file!(), ":", core::line!(), "] - ") ), $($arg)*);
        }
    }
}

#[cfg(any(all(debug_assertions, feature = "level_warn_off"), all(not(debug_assertions), feature = "release_level_warn_off") ) )]
#[macro_export]
///Writes warn log
macro_rules! warn {
    ($($arg:tt)*) => {
    }
}

#[cfg(any(all(debug_assertions, not(feature = "level_warn_off")), all(not(debug_assertions), not(feature = "release_level_warn_off")) ) )]
#[macro_export]
///Writes warn log
macro_rules! warn {
    ($($arg:tt)*) => {
        if $crate::is_enabled($crate::Level::WARN) {
            use core::fmt::Write;
            let _ = core::writeln!($crate::Out::warn(core::concat!("- [", core::file!(), ":", core::line!(), "] - ") ), $($arg)*);
        }
    }
}

#[cfg(any(all(debug_assertions, feature = "level_info_off"), all(not(debug_assertions), feature = "release_level_info_off") ) )]
#[macro_export]
///Writes info log
macro_rules! info {
    ($($arg:tt)*) => {
    }
}

#[cfg(any(all(debug_assertions, not(feature = "level_info_off")), all(not(debug_assertions), not(feature = "release_level_info_off")) ) )]
#[macro_export]
///Writes info log
macro_rules! info {
    ($($arg:tt)*) => {
        if $crate::is_enabled($crate::Level::INFO) {
            use core::fmt::Write;
            let _ = core::writeln!($crate::Out::info(core::concat!("- [", core::file!(), ":", core::line!(), "] - ") ), $($arg)*);
        }
    }
}

#[cfg(any(all(debug_assertions, feature = "level_debug_off"), all(not(debug_assertions), feature = "release_level_debug_off") ) )]
#[macro_export]
///Writes debug log
macro_rules! debug {
    ($($arg:tt)*) => {
    }
}

#[cfg(any(all(debug_assertions, not(feature = "level_debug_off")), all(not(debug_assertions), not(feature = "release_level_debug_off")) ) )]
#[macro_export]
///Writes debug log
macro_rules! debug {
    ($($arg:tt)*) => {
        if $crate::is_enabled($crate::Level::DEBUG) {
            use core::fmt::Write;
            let _ = core::writeln!($crate::Out::debug(core::concat!("- [", core::file!(), ":", core::line!(), "] - ") ), $($arg)*);
        }
    }
}

#[cfg(any(all(debug_assertions, feature = "level_trace_off"), all(not(debug_assertions), feature = "release_level_trace_off") ) )]
#[macro_export]
///Writes trace log
macro_rules! trace {
    ($($arg:tt)*) => {
    }
}

#[cfg(any(all(debug_assertions, not(feature = "level_trace_off")), all(not(debug_assertions), not(feature = "release_level_trace_off")) ) )]
#[macro_export]
///Writes trace log
macro_rules! trace {
    ($($arg:tt)*) => {
        if $crate::is_enabled($crate::Level::TRACE) {
            use core::fmt::Write;
            let _ = core::writeln!($crate::Out::trace(core::concat!("- [", core::file!(), ":", core::line!(), "] - ") ), $($arg)*);
        }
    }
}