mirror of
https://github.com/rust-lang/log.git
synced 2026-02-14 20:08:22 +00:00
Merge pull request #322 from dtolnay/missing
Improve error when missing macro argument
This commit is contained in:
commit
f8522dbeb6
@ -60,11 +60,11 @@ macro_rules! log {
|
||||
/// ```
|
||||
#[macro_export(local_inner_macros)]
|
||||
macro_rules! error {
|
||||
(target: $target:expr, $($arg:tt)*) => (
|
||||
log!(target: $target, $crate::Level::Error, $($arg)*);
|
||||
(target: $target:expr, $($arg:tt)+) => (
|
||||
log!(target: $target, $crate::Level::Error, $($arg)+);
|
||||
);
|
||||
($($arg:tt)*) => (
|
||||
log!($crate::Level::Error, $($arg)*);
|
||||
($($arg:tt)+) => (
|
||||
log!($crate::Level::Error, $($arg)+);
|
||||
)
|
||||
}
|
||||
|
||||
@ -84,11 +84,11 @@ macro_rules! error {
|
||||
/// ```
|
||||
#[macro_export(local_inner_macros)]
|
||||
macro_rules! warn {
|
||||
(target: $target:expr, $($arg:tt)*) => (
|
||||
log!(target: $target, $crate::Level::Warn, $($arg)*);
|
||||
(target: $target:expr, $($arg:tt)+) => (
|
||||
log!(target: $target, $crate::Level::Warn, $($arg)+);
|
||||
);
|
||||
($($arg:tt)*) => (
|
||||
log!($crate::Level::Warn, $($arg)*);
|
||||
($($arg:tt)+) => (
|
||||
log!($crate::Level::Warn, $($arg)+);
|
||||
)
|
||||
}
|
||||
|
||||
@ -110,11 +110,11 @@ macro_rules! warn {
|
||||
/// ```
|
||||
#[macro_export(local_inner_macros)]
|
||||
macro_rules! info {
|
||||
(target: $target:expr, $($arg:tt)*) => (
|
||||
log!(target: $target, $crate::Level::Info, $($arg)*);
|
||||
(target: $target:expr, $($arg:tt)+) => (
|
||||
log!(target: $target, $crate::Level::Info, $($arg)+);
|
||||
);
|
||||
($($arg:tt)*) => (
|
||||
log!($crate::Level::Info, $($arg)*);
|
||||
($($arg:tt)+) => (
|
||||
log!($crate::Level::Info, $($arg)+);
|
||||
)
|
||||
}
|
||||
|
||||
@ -135,11 +135,11 @@ macro_rules! info {
|
||||
/// ```
|
||||
#[macro_export(local_inner_macros)]
|
||||
macro_rules! debug {
|
||||
(target: $target:expr, $($arg:tt)*) => (
|
||||
log!(target: $target, $crate::Level::Debug, $($arg)*);
|
||||
(target: $target:expr, $($arg:tt)+) => (
|
||||
log!(target: $target, $crate::Level::Debug, $($arg)+);
|
||||
);
|
||||
($($arg:tt)*) => (
|
||||
log!($crate::Level::Debug, $($arg)*);
|
||||
($($arg:tt)+) => (
|
||||
log!($crate::Level::Debug, $($arg)+);
|
||||
)
|
||||
}
|
||||
|
||||
@ -162,11 +162,11 @@ macro_rules! debug {
|
||||
/// ```
|
||||
#[macro_export(local_inner_macros)]
|
||||
macro_rules! trace {
|
||||
(target: $target:expr, $($arg:tt)*) => (
|
||||
log!(target: $target, $crate::Level::Trace, $($arg)*);
|
||||
(target: $target:expr, $($arg:tt)+) => (
|
||||
log!(target: $target, $crate::Level::Trace, $($arg)+);
|
||||
);
|
||||
($($arg:tt)*) => (
|
||||
log!($crate::Level::Trace, $($arg)*);
|
||||
($($arg:tt)+) => (
|
||||
log!($crate::Level::Trace, $($arg)+);
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user