Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Minor tracing cleanup #1122

Merged
merged 3 commits into from
Apr 11, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 2 additions & 7 deletions shotover/src/runner.rs
Original file line number Diff line number Diff line change
Expand Up @@ -234,9 +234,7 @@ impl TracingState {
.with_env_filter(env_filter)
.with_filter_reloading();
let handle = ReloadHandle::Json(builder.reload_handle());
// To avoid unit tests that run in the same excutable from blowing up when they try to reinitialize tracing we ignore the result returned by try_init.
// Currently the implementation of try_init will only fail when it is called multiple times.
builder.try_init().ok();
builder.init();
handle
}
LogFormat::Human => {
Expand All @@ -245,13 +243,10 @@ impl TracingState {
.with_env_filter(env_filter)
.with_filter_reloading();
let handle = ReloadHandle::Human(builder.reload_handle());
builder.try_init().ok();
builder.init();
handle
}
};
if let LogFormat::Json = format {
crate::tracing_panic_handler::setup();
}

// When in json mode we need to process panics as events instead of printing directly to stdout.
// This is so that:
Expand Down