Crates.io | tracing-chrome |
lib.rs | tracing-chrome |
version | 0.7.2 |
source | src |
created_at | 2020-08-20 07:35:54.762437 |
updated_at | 2024-03-15 21:29:56.512825 |
description | A Layer for tracing-subscriber that outputs Chrome-style traces. |
homepage | |
repository | https://github.com/thoren-d/tracing-chrome |
max_upload_size | |
id | 278512 |
size | 50,614 |
tracing-chrome is a Layer for tracing-subscriber that outputs traces in Chrome's trace viewer format that can be viewed with chrome://tracing
or ui.perfetto.dev.
Add this near the beginning of main
:
use tracing_chrome::ChromeLayerBuilder;
use tracing_subscriber::{registry::Registry, prelude::*};
let (chrome_layer, _guard) = ChromeLayerBuilder::new().build();
tracing_subscriber::registry().with(chrome_layer).init();
When _guard
is dropped, your trace will be in a file like trace-1668480819035032.json
.
Open that file with ui.perfetto.dev (or chrome://tracing
) and take a look at your pretty trace.
Licensed under the MIT license
Unless you state otherwise, any contribution intentionally submitted for inclusion in the work shall be licensed as above.