[][src]Macro tokio_trace::error

macro_rules! error {
    (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)+ ) => { ... };
}

Constructs an event at the error 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 (err_info, port) = ("No connection", 22);

error!(port = port, error = field::display(err_info));
error!(target: "app_events", "App Error: {}", err_info);
error!({ info = err_info }, "error on port: {}", port);