[][src]Macro tokio_trace::info

macro_rules! info {
    (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 info 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 addr = Ipv4Addr::new(127, 0, 0, 1);
let conn_info = Connection { port: 40, speed: 3.20 };

info!({ port = conn_info.port }, "connected to {}", addr);
info!(
    target: "connection_events",
    ip = field::display(addr),
    port = conn_info.port,
    speed = field::debug(conn_info.speed)
);