Skip to content

Commit 831bd96

Browse files
committedMay 11, 2022
rustc_log: add env var to set verbose entry/exit behavior
1 parent d53f1e8 commit 831bd96

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed
 

‎compiler/rustc_log/src/lib.rs

+13
Original file line numberDiff line numberDiff line change
@@ -67,11 +67,24 @@ pub fn init_env_logger(env: &str) -> Result<(), Error> {
6767
Err(VarError::NotUnicode(_value)) => return Err(Error::NonUnicodeColorValue),
6868
};
6969

70+
let verbose_entry_exit = match env::var_os(String::from(env) + "_ENTRY_EXIT") {
71+
None => false,
72+
Some(v) => {
73+
if &v == "0" {
74+
false
75+
} else {
76+
true
77+
}
78+
}
79+
};
80+
7081
let layer = tracing_tree::HierarchicalLayer::default()
7182
.with_writer(io::stderr)
7283
.with_indent_lines(true)
7384
.with_ansi(color_logs)
7485
.with_targets(true)
86+
.with_verbose_exit(verbose_entry_exit)
87+
.with_verbose_entry(verbose_entry_exit)
7588
.with_indent_amount(2);
7689
#[cfg(parallel_compiler)]
7790
let layer = layer.with_thread_ids(true).with_thread_names(true);

0 commit comments

Comments
 (0)
Please sign in to comment.