diff --git a/tracing-core/Cargo.toml b/tracing-core/Cargo.toml index 59bd10045..091bfe7ce 100644 --- a/tracing-core/Cargo.toml +++ b/tracing-core/Cargo.toml @@ -35,7 +35,7 @@ maintenance = { status = "actively-developed" } [dependencies] once_cell = { version = "1.13.0", optional = true } -rubicon = "3.0.1" +rubicon = "3.2.0" [target.'cfg(tracing_unstable)'.dependencies] valuable = { version = "0.1.0", optional = true, default-features = false } diff --git a/tracing-core/src/lib.rs b/tracing-core/src/lib.rs index bcb13533d..7a243092f 100644 --- a/tracing-core/src/lib.rs +++ b/tracing-core/src/lib.rs @@ -292,3 +292,10 @@ pub use self::{metadata::Kind, subscriber::Interest}; mod sealed { pub trait Sealed {} } + +rubicon::compatibility_check! { + ("version", env!("CARGO_PKG_VERSION")), + + #[cfg(feature = "std")] + ("std", "enabled"), +} diff --git a/tracing-flame/Cargo.toml b/tracing-flame/Cargo.toml index ade44fa6f..d463ad69b 100644 --- a/tracing-flame/Cargo.toml +++ b/tracing-flame/Cargo.toml @@ -1,10 +1,7 @@ [package] name = "tracing-flame" version = "0.2.0" -authors = [ - "Jane Lusby ", - "Tokio Contributors " -] +authors = ["Jane Lusby ", "Tokio Contributors "] edition = "2018" license = "MIT" readme = "README.md" @@ -26,10 +23,15 @@ default = ["smallvec"] smallvec = ["tracing-subscriber/smallvec"] [dependencies] -tracing-subscriber = { path = "../tracing-subscriber", version = "0.3.0", default-features = false, features = ["registry", "fmt"] } -tracing = { path = "../tracing", version = "0.1.35", default-features = false, features = ["std"] } +tracing-subscriber = { path = "../tracing-subscriber", version = "0.3.0", default-features = false, features = [ + "registry", + "fmt", +] } +tracing = { path = "../tracing", version = "0.1.35", default-features = false, features = [ + "std", +] } once_cell = "1.13.0" -rubicon = "3.0.1" +rubicon = "3.2.0" [dev-dependencies] diff --git a/tracing-flame/src/lib.rs b/tracing-flame/src/lib.rs index 063b195bb..115ab41e0 100644 --- a/tracing-flame/src/lib.rs +++ b/tracing-flame/src/lib.rs @@ -157,9 +157,7 @@ use tracing_subscriber::Layer; mod error; -rubicon::process_local! { - static START: Lazy = Lazy::new(Instant::now); -} +static START: Lazy = Lazy::new(Instant::now); rubicon::thread_local! { static LAST_EVENT: Cell = Cell::new(*START); diff --git a/tracing-log/Cargo.toml b/tracing-log/Cargo.toml index eea734791..e5b3f4a91 100644 --- a/tracing-log/Cargo.toml +++ b/tracing-log/Cargo.toml @@ -8,10 +8,7 @@ homepage = "https://tokio.rs" description = """ Provides compatibility between `tracing` and the `log` crate. """ -categories = [ - "development-tools::debugging", - "asynchronous", -] +categories = ["development-tools::debugging", "asynchronous"] keywords = ["logging", "tracing", "log"] license = "MIT" readme = "README.md" @@ -24,15 +21,15 @@ log-tracer = [] interest-cache = ["lru", "ahash"] [dependencies] -tracing-core = { path = "../tracing-core", version = "0.1.28"} +tracing-core = { path = "../tracing-core", version = "0.1.28" } log = { version = "0.4.17" } once_cell = "1.13.0" lru = { version = "0.7.7", optional = true } ahash = { version = "0.7.7", optional = true } -rubicon = "3.0.1" +rubicon = "3.2.0" [dev-dependencies] -tracing = { path = "../tracing", version = "0.1.35"} +tracing = { path = "../tracing", version = "0.1.35" } tracing-subscriber = { path = "../tracing-subscriber" } criterion = { version = "0.3.6", default-features = false } diff --git a/tracing-subscriber/Cargo.toml b/tracing-subscriber/Cargo.toml index 9692ed058..8e5985ff9 100644 --- a/tracing-subscriber/Cargo.toml +++ b/tracing-subscriber/Cargo.toml @@ -27,12 +27,24 @@ rust-version = "1.63.0" default = ["smallvec", "fmt", "ansi", "tracing-log", "std"] alloc = [] std = ["alloc", "tracing-core/std"] -env-filter = ["matchers", "regex", "once_cell", "tracing", "std", "thread_local"] +env-filter = [ + "matchers", + "regex", + "once_cell", + "tracing", + "std", + "thread_local", +] fmt = ["registry", "std"] ansi = ["fmt", "nu-ansi-term"] registry = ["sharded-slab", "thread_local", "std"] json = ["tracing-serde", "serde", "serde_json"] -valuable = ["tracing-core/valuable", "valuable_crate", "valuable-serde", "tracing-serde/valuable"] +valuable = [ + "tracing-core/valuable", + "valuable_crate", + "valuable-serde", + "tracing-serde/valuable", +] # Enables support for local time when using the `time` crate timestamp # formatters. local-time = ["time/local-offset"] @@ -43,12 +55,19 @@ tracing-core = { path = "../tracing-core", version = "0.1.30", default-features # only required by the filter feature tracing = { optional = true, path = "../tracing", version = "0.1.35", default-features = false } matchers = { optional = true, version = "0.1.0" } -regex = { optional = true, version = "1.6.0", default-features = false, features = ["std", "unicode-case", "unicode-perl"] } +regex = { optional = true, version = "1.6.0", default-features = false, features = [ + "std", + "unicode-case", + "unicode-perl", +] } smallvec = { optional = true, version = "1.9.0" } once_cell = { optional = true, version = "1.13.0" } # fmt -tracing-log = { path = "../tracing-log", version = "0.2.0", optional = true, default-features = false, features = ["log-tracer", "std"] } +tracing-log = { path = "../tracing-log", version = "0.2.0", optional = true, default-features = false, features = [ + "log-tracer", + "std", +] } nu-ansi-term = { version = "0.46.0", optional = true } time = { version = "0.3.2", features = ["formatting"], optional = true } @@ -59,12 +78,15 @@ tracing-serde = { path = "../tracing-serde", version = "0.1.3", optional = true # opt-in deps parking_lot = { version = "0.12.1", optional = true } -chrono = { version = "0.4.26", default-features = false, features = ["clock", "std"], optional = true } +chrono = { version = "0.4.26", default-features = false, features = [ + "clock", + "std", +], optional = true } # registry sharded-slab = { version = "0.1.4", optional = true } thread_local = { version = "1.1.4", optional = true } -rubicon = "3.0.1" +rubicon = "3.2.0" [target.'cfg(tracing_unstable)'.dependencies] valuable_crate = { package = "valuable", version = "0.1.0", optional = true, default-features = false } @@ -77,7 +99,10 @@ log = "0.4.17" tracing-log = { path = "../tracing-log", version = "0.2.0" } criterion = { version = "0.3.6", default-features = false } regex = { version = "1", default-features = false, features = ["std"] } -tracing-futures = { path = "../tracing-futures", version = "0.2.0", default-features = false, features = ["std-future", "std"] } +tracing-futures = { path = "../tracing-futures", version = "0.2.0", default-features = false, features = [ + "std-future", + "std", +] } tokio = { version = "1", features = ["rt", "macros"] } # Enable the `time` crate's `macros` feature, for examples. time = { version = "0.3.2", features = ["formatting", "macros"] } diff --git a/tracing-subscriber/src/lib.rs b/tracing-subscriber/src/lib.rs index a6b570ee4..cb8669ddf 100644 --- a/tracing-subscriber/src/lib.rs +++ b/tracing-subscriber/src/lib.rs @@ -249,3 +249,34 @@ feature! { mod sealed { pub trait Sealed {} } + +rubicon::compatibility_check! { + ("version", env!("CARGO_PKG_VERSION")), + + #[cfg(feature = "std")] + ("std", "enabled"), + + #[cfg(feature = "alloc")] + ("alloc", "enabled"), + + #[cfg(feature = "env-filter")] + ("env-filter", "enabled"), + + #[cfg(feature = "fmt")] + ("fmt", "enabled"), + + #[cfg(feature = "ansi")] + ("ansi", "enabled"), + + #[cfg(feature = "registry")] + ("registry", "enabled"), + + #[cfg(feature = "json")] + ("json", "enabled"), + + #[cfg(feature = "valuable")] + ("valuable", "enabled"), + + #[cfg(feature = "local-time")] + ("local-time", "enabled"), +} diff --git a/tracing/Cargo.toml b/tracing/Cargo.toml index 5b2e037f4..161d152ac 100644 --- a/tracing/Cargo.toml +++ b/tracing/Cargo.toml @@ -9,7 +9,10 @@ name = "tracing" # - Update CHANGELOG.md. # - Create "v0.1.x" git tag version = "0.1.40" -authors = ["Eliza Weisman ", "Tokio Contributors "] +authors = [ + "Eliza Weisman ", + "Tokio Contributors ", +] license = "MIT" readme = "README.md" repository = "https://github.com/tokio-rs/tracing" @@ -32,7 +35,7 @@ tracing-core = { path = "../tracing-core", version = "0.1.32", default-features log = { version = "0.4.17", optional = true } tracing-attributes = { path = "../tracing-attributes", version = "0.1.27", optional = true } pin-project-lite = "0.2.9" -rubicon = "3.0.1" +rubicon = "3.2.0" [dev-dependencies] criterion = { version = "0.3.6", default_features = false } @@ -46,17 +49,17 @@ wasm-bindgen-test = "0.3.38" [features] default = ["std", "attributes"] -max_level_off = [] +max_level_off = [] max_level_error = [] -max_level_warn = [] -max_level_info = [] +max_level_warn = [] +max_level_info = [] max_level_debug = [] max_level_trace = [] -release_max_level_off = [] +release_max_level_off = [] release_max_level_error = [] -release_max_level_warn = [] -release_max_level_info = [] +release_max_level_warn = [] +release_max_level_info = [] release_max_level_debug = [] release_max_level_trace = [] diff --git a/tracing/src/lib.rs b/tracing/src/lib.rs index f9a44f04c..5912ff447 100644 --- a/tracing/src/lib.rs +++ b/tracing/src/lib.rs @@ -1129,3 +1129,61 @@ pub mod log { mod sealed { pub trait Sealed {} } + +rubicon::compatibility_check! { + ("version", env!("CARGO_PKG_VERSION")), + + #[cfg(feature = "std")] + ("std", "enabled"), + + #[cfg(feature = "attributes")] + ("attributes", "enabled"), + + // These are all just compile-time filters + + // #[cfg(feature = "max_level_off")] + // ("max_level_off", "enabled"), + + // #[cfg(feature = "max_level_error")] + // ("max_level_error", "enabled"), + + // #[cfg(feature = "max_level_warn")] + // ("max_level_warn", "enabled"), + + // #[cfg(feature = "max_level_info")] + // ("max_level_info", "enabled"), + + // #[cfg(feature = "max_level_debug")] + // ("max_level_debug", "enabled"), + + // #[cfg(feature = "max_level_trace")] + // ("max_level_trace", "enabled"), + + // #[cfg(feature = "release_max_level_off")] + // ("release_max_level_off", "enabled"), + + // #[cfg(feature = "release_max_level_error")] + // ("release_max_level_error", "enabled"), + + // #[cfg(feature = "release_max_level_warn")] + // ("release_max_level_warn", "enabled"), + + // #[cfg(feature = "release_max_level_info")] + // ("release_max_level_info", "enabled"), + + // #[cfg(feature = "release_max_level_debug")] + // ("release_max_level_debug", "enabled"), + + // #[cfg(feature = "release_max_level_trace")] + // ("release_max_level_trace", "enabled"), + + // That one is deprecated + // #[cfg(feature = "async-await")] + // ("async-await", "enabled"), + + #[cfg(feature = "log-always")] + ("log-always", "enabled"), + + #[cfg(feature = "valuable")] + ("valuable", "enabled"), +}