Function init_with_chrome_trace_exporter

Source
pub fn init_with_chrome_trace_exporter<W>(
    log_name: &str,
    writer: W,
) -> ChromeTraceGuard
where W: Write + Send + 'static,
Expand description

Initializes tracing with Chrome Trace JSON exporter.

Returns a guard that must be kept alive for the duration of the program. When the guard is dropped, the trace data is flushed and completed.

Exports traces to Chrome Trace JSON format which can be visualized in:

Note: Uses try_init() to avoid panicking if a global subscriber is already set. In that case, tracing may not work as expected.