Crates.io | rs_tracing |
lib.rs | rs_tracing |
version | 1.1.0 |
source | src |
created_at | 2019-01-26 22:12:59.588935 |
updated_at | 2022-12-18 21:16:13.611856 |
description | trace events in the trace event format |
homepage | |
repository | https://github.com/andjo403/rs_tracing.git |
max_upload_size | |
id | 110816 |
size | 18,936 |
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");