about summary refs log tree commit diff
path: root/src/librustc_driver
diff options
context:
space:
mode:
authorOliver Scherer <github35764891676564198441@oli-obk.de>2020-07-24 20:42:00 +0200
committerOliver Scherer <github35764891676564198441@oli-obk.de>2020-07-31 22:38:20 +0200
commitec7230fea2f4a96a1993c54bf2b17892d2e978b4 (patch)
tree4761e206797c576bfbde450aa2b0f338ce298f8a /src/librustc_driver
parent6e87bacd37539b7e7cd75152dffd225047fa983a (diff)
Move from `log` to `tracing`
Diffstat (limited to 'src/librustc_driver')
-rw-r--r--src/librustc_driver/Cargo.toml4
-rw-r--r--src/librustc_driver/lib.rs6
2 files changed, 7 insertions, 3 deletions
diff --git a/src/librustc_driver/Cargo.toml b/src/librustc_driver/Cargo.toml
index 75d65920766..69dd221ef96 100644
--- a/src/librustc_driver/Cargo.toml
+++ b/src/librustc_driver/Cargo.toml
@@ -12,8 +12,8 @@ crate-type = ["dylib"]
 [dependencies]
 lazy_static = "1.0"
 libc = "0.2"
-log = "0.4"
-env_logger = { version = "0.7", default-features = false }
+log = { package = "tracing", version = "0.1.18", features = ["release_max_level_info"]  }
+tracing-subscriber = { version = "0.2.10", features = ["fmt", "env-filter"] }
 rustc_middle = { path = "../librustc_middle" }
 rustc_ast_pretty = { path = "../librustc_ast_pretty" }
 rustc_target = { path = "../librustc_target" }
diff --git a/src/librustc_driver/lib.rs b/src/librustc_driver/lib.rs
index ab4eac9440b..6faffae305d 100644
--- a/src/librustc_driver/lib.rs
+++ b/src/librustc_driver/lib.rs
@@ -1226,7 +1226,11 @@ pub fn install_ice_hook() {
 /// This allows tools to enable rust logging without having to magically match rustc's
 /// log crate version
 pub fn init_rustc_env_logger() {
-    env_logger::init_from_env("RUSTC_LOG");
+    let builder = tracing_subscriber::FmtSubscriber::builder();
+
+    let builder = builder.with_env_filter(tracing_subscriber::EnvFilter::from_env("RUSTC_LOG"));
+
+    builder.init()
 }
 
 pub fn main() -> ! {