Skip to content
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
20 changes: 14 additions & 6 deletions crates/rust-analyzer/src/tracing/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -58,14 +58,22 @@ where
let writer = self.writer;

let ra_fmt_layer = tracing_subscriber::fmt::layer()
.with_timer(
time::OffsetTime::local_rfc_3339()
.expect("Could not get local offset, make sure you're on the main thread"),
)
.with_target(false)
.with_ansi(false)
.with_writer(writer)
.with_filter(targets_filter);
.with_writer(writer);

let ra_fmt_layer = match time::OffsetTime::local_rfc_3339() {
Ok(timer) => {
// If we can get the time offset, format logs with the timezone.
ra_fmt_layer.with_timer(timer).boxed()
}
Err(_) => {
// Use system time if we can't get the time offset. This should
// never happen on Linux, but can happen on e.g. OpenBSD.
ra_fmt_layer.boxed()
}
}
.with_filter(targets_filter);

let chalk_layer = match self.chalk_filter {
Some(chalk_filter) => {
Expand Down