macro_rules! warn {
(target: $target:expr, { $( $($k:ident).+ = $val:expr ),*, }, $($arg:tt)+ ) => { ... };
(target: $target:expr, { $( $($k:ident).+ = $val:expr ),* }, $($arg:tt)+ ) => { ... };
(target: $target:expr, $( $($k:ident).+ = $val:expr ),*, ) => { ... };
(target: $target:expr, $( $($k:ident).+ = $val:expr ),* ) => { ... };
(target: $target:expr, $($arg:tt)+ ) => { ... };
({ $( $($k:ident).+ = $val:expr ),*, }, $($arg:tt)+ ) => { ... };
({ $( $($k:ident).+ = $val:expr ),* }, $($arg:tt)+ ) => { ... };
($( $($k:ident).+ = $val:expr ),*, ) => { ... };
($( $($k:ident).+ = $val:expr ),* ) => { ... };
($($arg:tt)+ ) => { ... };
}
Expand description
Constructs an event at the warn level.
When both a message and fields are included, curly braces ({
and }
) are
used to delimit the list of fields from the format string for the message.
A trailing comma on the final field is valid.
ยงExamples
use tokio_trace::field;
let warn_description = "Invalid Input";
let input = &[0x27, 0x45];
warn!(input = field::debug(input), warning = warn_description);
warn!(
target: "input_events",
{ warning = warn_description },
"Received warning for input: {:?}", input,
);