chore(resolver): remove tracing_subscriber (#1362)

this is no longer required for rspack
This commit is contained in:
Boshen 2023-11-17 13:34:54 +08:00 committed by GitHub
parent c6957ae8f1
commit 3bfe05ec7c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 0 additions and 21 deletions

1
Cargo.lock generated
View file

@ -1826,7 +1826,6 @@ dependencies = [
"serde_json",
"thiserror",
"tracing",
"tracing-subscriber",
"vfs",
]

View file

@ -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"]

View file

@ -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

View file

@ -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<Fs: FileSystem + Default> Default for ResolverGeneric<Fs> {
impl<Fs: FileSystem + Default> ResolverGeneric<Fs> {
pub fn new(options: ResolveOptions) -> Self {
#[cfg(feature = "tracing-subscriber")]
tracing_subscriber::init();
Self { options: options.sanitize(), cache: Arc::new(Cache::default()) }
}

View file

@ -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();
});
}