1 use util::logger::Record;
3 macro_rules! log_internal {
4 ($self: ident, $lvl:expr, $($arg:tt)+) => (
5 &$self.logger.log(&Record::new($lvl, format_args!($($arg)+), module_path!(), file!(), line!()));
9 macro_rules! log_error {
10 ($self: ident, $($arg:tt)*) => (
11 #[cfg(not(any(feature = "max_level_off")))]
12 log_internal!($self, $crate::util::logger::Level::Error, $($arg)*);
16 macro_rules! log_warn {
17 ($self: ident, $($arg:tt)*) => (
18 #[cfg(not(any(feature = "max_level_off", feature = "max_level_error")))]
19 log_internal!($self, $crate::util::logger::Level::Warn, $($arg)*);
23 macro_rules! log_info {
24 ($self: ident, $($arg:tt)*) => (
25 #[cfg(not(any(feature = "max_level_off", feature = "max_level_error", feature = "max_level_warn")))]
26 log_internal!($self, $crate::util::logger::Level::Info, $($arg)*);
30 macro_rules! log_debug {
31 ($self: ident, $($arg:tt)*) => (
32 #[cfg(not(any(feature = "max_level_off", feature = "max_level_error", feature = "max_level_warn", feature = "max_level_info")))]
33 log_internal!($self, $crate::util::logger::Level::Debug, $($arg)*);
37 macro_rules! log_trace {
38 ($self: ident, $($arg:tt)*) => (
39 #[cfg(not(any(feature = "max_level_off", feature = "max_level_error", feature = "max_level_warn", feature = "max_level_info", feature = "max_level_debug")))]
40 log_internal!($self, $crate::util::logger::Level::Trace, $($arg)*);