macro_rules! span_scope_named_dyn {
(name = $name:expr $(, $($rest:tt)*)?) => { ... };
($static_var_name:ident, $name:expr) => { ... };
($name:expr) => { ... };
}Expand description
Records a span whose name is built at runtime, such as format!(..) or a &String.
The name is copied into each block that records one of the span’s events, so a high
number of distinct names does not accumulate in memory.
The guard owns the name, which is kept alive until the end of the scope.
§Examples
use micromegas_tracing::span_scope_named_dyn;
let asset = String::from("hero.png");
span_scope_named_dyn!(format!("load {asset}"));span_scope_named_dyn!(name = format!(..), key = value, ..) returns a guard whose end event
carries properties; see span_scope!.
use micromegas_tracing::prelude::*;
let asset = String::from("hero.png");
let mut span = span_scope_named_dyn!(name = format!("load {asset}"), kind = "texture");
span.set_property("bytes", 1024);