diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 61cc9a7a0e..4d4c465fef 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -283,7 +283,7 @@ jobs: for example in .github/example-run/*.ron; do example_name=`basename $example .ron` echo "running $example_name - "`date` - time CI_TESTING_CONFIG=$example xvfb-run cargo run --example $example_name --no-default-features --features "bevy_dynamic_plugin,bevy_gilrs,bevy_gltf,bevy_winit,render,png,hdr,x11,bevy_ci_testing,trace,trace_chrome,bevy_audio,vorbis" + time TRACE_CHROME=trace-$example_name.json CI_TESTING_CONFIG=$example xvfb-run cargo run --example $example_name --no-default-features --features "bevy_dynamic_plugin,bevy_gilrs,bevy_gltf,bevy_winit,render,png,hdr,x11,bevy_ci_testing,trace,trace_chrome,bevy_audio,vorbis" sleep 10 done zip traces.zip trace*.json diff --git a/crates/bevy_log/src/lib.rs b/crates/bevy_log/src/lib.rs index 0dd24a477d..0259aafd71 100644 --- a/crates/bevy_log/src/lib.rs +++ b/crates/bevy_log/src/lib.rs @@ -137,7 +137,11 @@ impl Plugin for LogPlugin { { #[cfg(feature = "tracing-chrome")] let chrome_layer = { - let (chrome_layer, guard) = tracing_chrome::ChromeLayerBuilder::new() + let mut layer = tracing_chrome::ChromeLayerBuilder::new(); + if let Ok(path) = std::env::var("TRACE_CHROME") { + layer = layer.file(path); + } + let (chrome_layer, guard) = layer .name_fn(Box::new(|event_or_span| match event_or_span { tracing_chrome::EventOrSpan::Event(event) => event.metadata().name().into(), tracing_chrome::EventOrSpan::Span(span) => {