Skip to content

Commit 57f225e

Browse files
committed
replace path-kludge with simple ident that relies on [macro_use]
1 parent 66864fc commit 57f225e

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

src/log/mod.rs

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -9,20 +9,20 @@ mod simple_logger;
99
mod syslog;
1010

1111
macro_rules! logger_macro {
12-
($name:ident is $rule_level:ident to $target:literal with $($path1:ident)?$(::$path2:ident)*, $d:tt) => {
12+
($name:ident is $rule_level:ident to $target:literal with $filter:ident, $d:tt) => {
1313
macro_rules! $name {
1414
($d($d arg:tt)+) => {
1515
if let Some(logger) = $crate::log::LOGGER.get() {
16-
logger.log($crate::log::Level::$rule_level, $target, $($path1)?$(::$path2)*!($d($d arg)+));
16+
logger.log($crate::log::Level::$rule_level, $target, $filter!($d($d arg)+));
1717
}
1818
};
1919
}
2020

2121
pub(crate) use $name;
2222
};
2323

24-
($name:ident is $rule_level:ident to $target:literal with $($path1:ident)?$(::$path2:ident)*) => {
25-
logger_macro!($name is $rule_level to $target with $($path1)?$(::$path2)*, $);
24+
($name:ident is $rule_level:ident to $target:literal with $filter:ident) => {
25+
logger_macro!($name is $rule_level to $target with $filter, $);
2626
};
2727
}
2828

@@ -32,11 +32,11 @@ logger_macro!(auth_info is Info to "sudo::auth" with format_args);
3232
// logger_macro!(auth_debug is Debug to "sudo::auth" with format_args);
3333
// logger_macro!(auth_trace is Trace to "sudo::auth" with format_args);
3434

35-
logger_macro!(user_error is Error to "sudo::user" with crate::gettext::xlat);
36-
logger_macro!(user_warn is Warn to "sudo::user" with crate::gettext::xlat);
37-
logger_macro!(user_info is Info to "sudo::user" with crate::gettext::xlat);
38-
// logger_macro!(user_debug is Debug to "sudo::user" with crate::gettext::xlat);
39-
// logger_macro!(user_trace is Trace to "sudo::user" with crate::gettext::xlat);
35+
logger_macro!(user_error is Error to "sudo::user" with xlat);
36+
logger_macro!(user_warn is Warn to "sudo::user" with xlat);
37+
logger_macro!(user_info is Info to "sudo::user" with xlat);
38+
// logger_macro!(user_debug is Debug to "sudo::user" with xlat);
39+
// logger_macro!(user_trace is Trace to "sudo::user" with xlat);
4040

4141
macro_rules! dev_logger_macro {
4242
($name:ident is $rule_level:ident to $target:expr, $d:tt) => {

0 commit comments

Comments
 (0)