Skip to content

Commit

Permalink
Fix separator and treating expression
Browse files Browse the repository at this point in the history
  • Loading branch information
MikuroXina authored and emilio committed Oct 27, 2021
1 parent b4cd6e4 commit f91e1a6
Showing 1 changed file with 14 additions and 14 deletions.
28 changes: 14 additions & 14 deletions src/log_stubs.rs
Original file line number Diff line number Diff line change
@@ -1,32 +1,32 @@
#![allow(unused)]

macro_rules! log {
(target: $target:expr, $lvl:expr, $($arg:tt)+) => {
(target: $target:expr, $lvl:expr, $($arg:tt)+) => {{
let _ = $target;
let _ = log!($lvl, $($arg)+);
}
($lvl:expr, $($arg:tt)+) => {
}};
($lvl:expr, $($arg:tt)+) => {{
let _ = $lvl;
let _ = format_args!($($arg)+);
}
}};
}
macro_rules! error {
(target: $target:expr, $($arg:tt)+) => { log!(target: $target, "", $($arg)+); }
($($arg:tt)+) => { log!("", $($arg)+); }
(target: $target:expr, $($arg:tt)+) => { log!(target: $target, "", $($arg)+) };
($($arg:tt)+) => { log!("", $($arg)+) };
}
macro_rules! warn {
(target: $target:expr, $($arg:tt)*) => { log!(target: $target, "", $($arg)*); }
($($arg:tt)*) => { log!("", $($arg)*); }
(target: $target:expr, $($arg:tt)*) => { log!(target: $target, "", $($arg)*) };
($($arg:tt)*) => { log!("", $($arg)*) };
}
macro_rules! info {
(target: $target:expr, $($arg:tt)+) => { log!(target: $target, "", $($arg)+); }
($($arg:tt)+) => { log!("", $($arg)+); }
(target: $target:expr, $($arg:tt)+) => { log!(target: $target, "", $($arg)+) };
($($arg:tt)+) => { log!("", $($arg)+) };
}
macro_rules! debug {
(target: $target:expr, $($arg:tt)+) => { log!(target: $target, "", $($arg)+); }
($($arg:tt)+) => { log!("", $($arg)+); }
(target: $target:expr, $($arg:tt)+) => { log!(target: $target, "", $($arg)+) };
($($arg:tt)+) => { log!("", $($arg)+) };
}
macro_rules! trace {
(target: $target:expr, $($arg:tt)+) => { log!(target: $target, "", $($arg)+); }
($($arg:tt)+) => { log!("", $($arg)+); }
(target: $target:expr, $($arg:tt)+) => { log!(target: $target, "", $($arg)+) };
($($arg:tt)+) => { log!("", $($arg)+) };
}

0 comments on commit f91e1a6

Please sign in to comment.