about summary refs log tree commit diff
diff options
context:
space:
mode:
authorOli Scherer <git-spam-no-reply9815368754983@oli-obk.de>2024-06-11 08:55:48 +0000
committerOli Scherer <git-spam-no-reply9815368754983@oli-obk.de>2024-06-12 10:11:41 +0000
commit185a48d4b266722d550474a620c0e37e28b1c6d6 (patch)
tree13fbce22419029227d04d270a4f9692d736f4538
parent76c73827dcd0b363e60b22c3cef64bde4171bf17 (diff)
downloadrust-185a48d4b266722d550474a620c0e37e28b1c6d6.tar.gz
rust-185a48d4b266722d550474a620c0e37e28b1c6d6.zip
Bump tracing-tree and allow rendering lines again
-rw-r--r--compiler/rustc_log/Cargo.toml2
-rw-r--r--compiler/rustc_log/src/lib.rs8
2 files changed, 9 insertions, 1 deletions
diff --git a/compiler/rustc_log/Cargo.toml b/compiler/rustc_log/Cargo.toml
index 3ff86f700a5..fe399bc77e3 100644
--- a/compiler/rustc_log/Cargo.toml
+++ b/compiler/rustc_log/Cargo.toml
@@ -8,7 +8,7 @@ edition = "2021"
 tracing = "0.1.28"
 tracing-core = "=0.1.30" # FIXME(Nilstrieb) tracing has a deadlock: https://github.com/tokio-rs/tracing/issues/2635
 tracing-subscriber = { version = "0.3.3", default-features = false, features = ["fmt", "env-filter", "smallvec", "parking_lot", "ansi"] }
-tracing-tree = "0.3.0"
+tracing-tree = "0.3.1"
 # tidy-alphabetical-end
 
 [dev-dependencies]
diff --git a/compiler/rustc_log/src/lib.rs b/compiler/rustc_log/src/lib.rs
index 41b26ecce3c..01b6e342df0 100644
--- a/compiler/rustc_log/src/lib.rs
+++ b/compiler/rustc_log/src/lib.rs
@@ -58,6 +58,7 @@ pub struct LoggerConfig {
     pub verbose_thread_ids: Result<String, VarError>,
     pub backtrace: Result<String, VarError>,
     pub wraptree: Result<String, VarError>,
+    pub lines: Result<String, VarError>,
 }
 
 impl LoggerConfig {
@@ -69,6 +70,7 @@ impl LoggerConfig {
             verbose_thread_ids: env::var(format!("{env}_THREAD_IDS")),
             backtrace: env::var(format!("{env}_BACKTRACE")),
             wraptree: env::var(format!("{env}_WRAPTREE")),
+            lines: env::var(format!("{env}_LINES")),
         }
     }
 }
@@ -101,6 +103,11 @@ pub fn init_logger(cfg: LoggerConfig) -> Result<(), Error> {
         Err(_) => false,
     };
 
+    let lines = match cfg.lines {
+        Ok(v) => &v == "1",
+        Err(_) => false,
+    };
+
     let mut layer = tracing_tree::HierarchicalLayer::default()
         .with_writer(io::stderr)
         .with_ansi(color_logs)
@@ -108,6 +115,7 @@ pub fn init_logger(cfg: LoggerConfig) -> Result<(), Error> {
         .with_verbose_exit(verbose_entry_exit)
         .with_verbose_entry(verbose_entry_exit)
         .with_indent_amount(2)
+        .with_indent_lines(lines)
         .with_thread_ids(verbose_thread_ids)
         .with_thread_names(verbose_thread_ids);