From 3bfe05ec7cf9cd2482765cd30ebdd387bd1f108d Mon Sep 17 00:00:00 2001 From: Boshen Date: Fri, 17 Nov 2023 13:34:54 +0800 Subject: [PATCH] chore(resolver): remove tracing_subscriber (#1362) this is no longer required for rspack --- Cargo.lock | 1 - crates/oxc_resolver/Cargo.toml | 4 ---- crates/oxc_resolver/README.md | 2 -- crates/oxc_resolver/src/lib.rs | 4 ---- crates/oxc_resolver/src/tracing_subscriber.rs | 10 ---------- 5 files changed, 21 deletions(-) delete mode 100644 crates/oxc_resolver/src/tracing_subscriber.rs diff --git a/Cargo.lock b/Cargo.lock index dd4dfc1f7..9619b2718 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1826,7 +1826,6 @@ dependencies = [ "serde_json", "thiserror", "tracing", - "tracing-subscriber", "vfs", ] diff --git a/crates/oxc_resolver/Cargo.toml b/crates/oxc_resolver/Cargo.toml index f1413609f..8d65f853d 100644 --- a/crates/oxc_resolver/Cargo.toml +++ b/crates/oxc_resolver/Cargo.toml @@ -30,10 +30,6 @@ indexmap = { workspace = true, features = ["serde"] } # serde for Deserialize fr dunce = "1.0.4" # Normalize Windows paths to the most compatible format, avoiding UNC where possible once_cell = "1.18.0" # Use `std::sync::OnceLock::get_or_try_init` when it is stable. thiserror = { workspace = true } -tracing-subscriber = { workspace = true, optional = true, features = ["env-filter"] } [dev-dependencies] vfs = "0.10.0" # for testing with in memory file system - -[features] -tracing-subscriber = ["dep:tracing-subscriber"] diff --git a/crates/oxc_resolver/README.md b/crates/oxc_resolver/README.md index f0b283be2..230d5b03a 100644 --- a/crates/oxc_resolver/README.md +++ b/crates/oxc_resolver/README.md @@ -6,8 +6,6 @@ * support paths alias defined in `tsconfig.compilerOptions.paths` * support project references defined `tsconfig.references` * contains `tracing` instrumentation - * Install `tracing_subscriber` in your app - * or opt-in to the subscriber with `--features tracing-subscriber` and use `OXC_RESOLVER=DEBUG` env variable #### Resolver Options diff --git a/crates/oxc_resolver/src/lib.rs b/crates/oxc_resolver/src/lib.rs index 16b7030e2..359952e43 100644 --- a/crates/oxc_resolver/src/lib.rs +++ b/crates/oxc_resolver/src/lib.rs @@ -25,8 +25,6 @@ mod package_json; mod path; mod resolution; mod specifier; -#[cfg(feature = "tracing-subscriber")] -mod tracing_subscriber; mod tsconfig; #[cfg(test)] @@ -142,8 +140,6 @@ impl Default for ResolverGeneric { impl ResolverGeneric { pub fn new(options: ResolveOptions) -> Self { - #[cfg(feature = "tracing-subscriber")] - tracing_subscriber::init(); Self { options: options.sanitize(), cache: Arc::new(Cache::default()) } } diff --git a/crates/oxc_resolver/src/tracing_subscriber.rs b/crates/oxc_resolver/src/tracing_subscriber.rs deleted file mode 100644 index 6fe26e457..000000000 --- a/crates/oxc_resolver/src/tracing_subscriber.rs +++ /dev/null @@ -1,10 +0,0 @@ -use once_cell::sync::OnceCell; -use tracing_subscriber::{fmt, prelude::*, registry, EnvFilter}; - -static SUBSCRIBER: OnceCell<()> = OnceCell::new(); - -pub fn init() { - SUBSCRIBER.get_or_init(|| { - registry().with(fmt::layer()).with(EnvFilter::from_env("OXC_RESOLVER")).init(); - }); -}