Traces to Chrome's trace_event format
Cargo.toml:
rs_tracing = { version = "1.0", features = ["rs_tracing"] }
main.rs:
fn main() {
open_trace_file!(".").unwrap();
{
trace_scoped!("complete","custom data":"main");
trace_expr!("trace_expr", println!("trace_expr"));
trace_begin!("duration");
println!("trace_duration");
trace_end!("duration");
}
close_trace_file!();
}
also possible to add custom data to all the macros formated like the serde_json::json! macro e.g.
trace_scoped!("complete","custom":230,"more":"data");