Skip to content

Commit 9dfe4af

Browse files
authored
Rollup merge of rust-lang#109926 - SparrowLii:parallel_log, r=eholk
write threads info into log only when debugging The current tracing log will unconditionally write thread information during parallel compilation, which sometimes confuses some normal output log information This fixes the UI test failure of: ``` [ui] tests/ui/consts/const_in_pattern/issue-73431.rs ``` Updates rust-lang#75760
2 parents 836504e + 8b21f9e commit 9dfe4af

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

compiler/rustc_log/src/lib.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ pub fn init_env_logger(env: &str) -> Result<(), Error> {
8383
.with_verbose_exit(verbose_entry_exit)
8484
.with_verbose_entry(verbose_entry_exit)
8585
.with_indent_amount(2);
86-
#[cfg(parallel_compiler)]
86+
#[cfg(all(parallel_compiler, debug_assertions))]
8787
let layer = layer.with_thread_ids(true).with_thread_names(true);
8888

8989
let subscriber = tracing_subscriber::Registry::default().with(filter).with(layer);

src/librustdoc/lib.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,7 @@ fn init_logging() {
203203
.with_verbose_exit(true)
204204
.with_verbose_entry(true)
205205
.with_indent_amount(2);
206-
#[cfg(parallel_compiler)]
206+
#[cfg(all(parallel_compiler, debug_assertions))]
207207
let layer = layer.with_thread_ids(true).with_thread_names(true);
208208

209209
use tracing_subscriber::layer::SubscriberExt;

0 commit comments

Comments
 (0)