[−][src]Macro tokio_trace::trace
Constructs an event at the trace 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 pos = Position { x: 3.234, y: -1.223 }; let origin_dist = pos.dist(Position::ORIGIN); trace!(position = field::debug(pos), origin_dist = field::debug(origin_dist)); trace!(target: "app_events", { position = field::debug(pos) }, "x is {} and y is {}", if pos.x >= 0.0 { "positive" } else { "negative" }, if pos.y >= 0.0 { "positive" } else { "negative" });