diff options
| author | 许杰友 Jieyou Xu (Joe) <39484203+jieyouxu@users.noreply.github.com> | 2025-01-25 15:59:29 +0800 |
|---|---|---|
| committer | 许杰友 Jieyou Xu (Joe) <39484203+jieyouxu@users.noreply.github.com> | 2025-01-27 01:24:53 +0800 |
| commit | 4febbd5c09332776bf1fe7e979f8651705c18b27 (patch) | |
| tree | a7b0874586b35bf9f43c893408d9888cd462f46c /src/bootstrap | |
| parent | 15c6f7e1a3a0e51c9b18ce5b9a391e0c324b751c (diff) | |
| download | rust-4febbd5c09332776bf1fe7e979f8651705c18b27.tar.gz rust-4febbd5c09332776bf1fe7e979f8651705c18b27.zip | |
bootstrap: avoid glob imports in `main` binary
Diffstat (limited to 'src/bootstrap')
| -rw-r--r-- | src/bootstrap/src/bin/main.rs | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/src/bootstrap/src/bin/main.rs b/src/bootstrap/src/bin/main.rs index 8ebd6b8aa54..90bbbf49a77 100644 --- a/src/bootstrap/src/bin/main.rs +++ b/src/bootstrap/src/bin/main.rs @@ -16,11 +16,7 @@ use bootstrap::{ }; use build_helper::ci::CiEnv; #[cfg(feature = "tracing")] -use tracing::*; -#[cfg(feature = "tracing")] -use tracing_subscriber::EnvFilter; -#[cfg(feature = "tracing")] -use tracing_subscriber::prelude::*; +use tracing::{instrument, trace}; #[cfg_attr(feature = "tracing", instrument(level = "trace", name = "main"))] fn main() { @@ -211,6 +207,9 @@ fn check_version(config: &Config) -> Option<String> { // "tracing", instrument(..))]`. #[cfg(feature = "tracing")] fn setup_tracing() { + use tracing_subscriber::EnvFilter; + use tracing_subscriber::layer::SubscriberExt; + let filter = EnvFilter::from_env("BOOTSTRAP_TRACING"); let layer = tracing_tree::HierarchicalLayer::default() .with_writer(std::io::stderr) |
