From 40f757da053a0c46ed0e476881e6e5f0d4007b3a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Beno=C3=AEt=20Burnichon?= Date: Wed, 4 Oct 2023 20:09:04 +0200 Subject: [PATCH 01/10] subscriber: update documentation link to latest (#2434) Currently, link points to an outdated version. Make the link point to latest released version --- tracing-subscriber/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tracing-subscriber/README.md b/tracing-subscriber/README.md index 7c1212c6a9..f1b7a03f2f 100644 --- a/tracing-subscriber/README.md +++ b/tracing-subscriber/README.md @@ -21,7 +21,7 @@ Utilities for implementing and composing [`tracing`][tracing] subscribers. [crates-badge]: https://img.shields.io/crates/v/tracing-subscriber.svg [crates-url]: https://crates.io/crates/tracing-subscriber [docs-badge]: https://docs.rs/tracing-subscriber/badge.svg -[docs-url]: https://docs.rs/tracing-subscriber/0.3.15 +[docs-url]: https://docs.rs/tracing-subscriber/latest [docs-master-badge]: https://img.shields.io/badge/docs-master-blue [docs-master-url]: https://tracing-rs.netlify.com/tracing_subscriber [mit-badge]: https://img.shields.io/badge/license-MIT-blue.svg From 8cdc9da2020d4c9e467dd094008dbbb96c87c402 Mon Sep 17 00:00:00 2001 From: AnthonyMikh Date: Sun, 15 Oct 2023 22:48:38 +0400 Subject: [PATCH 02/10] appender: remove `Sync` bound from writer for `NonBlocking` (#2607) ## Motivation `NonBlocking` from `tracing-appender` wraps a writer and requires that writer to implement `Sync` (among other bounds). However it is not clear why this bound is necessary in first place: this writer is sent to a dedicated thread and never used directly concurrently. #1934 demonstrates that it is a real problem for some people. Also at my current work we hit this issue as well when a third-party writer did not implement `Sync`. Our workaround was to wrap that writer in our own type and manually implement `Send` and `Sync` for it. Needless to say that it is more a hack than a proper solution. ## Solution Remove `Sync` bound in relevant places. Yep, that simple. Probably having it in first place was just an oversight. Closes #1934 --- tracing-appender/src/lib.rs | 2 +- tracing-appender/src/non_blocking.rs | 6 +++--- tracing-appender/src/worker.rs | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/tracing-appender/src/lib.rs b/tracing-appender/src/lib.rs index 9fe789e50a..4964e89ac9 100644 --- a/tracing-appender/src/lib.rs +++ b/tracing-appender/src/lib.rs @@ -190,7 +190,7 @@ pub(crate) mod sync; /// }); /// # } /// ``` -pub fn non_blocking(writer: T) -> (NonBlocking, WorkerGuard) { +pub fn non_blocking(writer: T) -> (NonBlocking, WorkerGuard) { NonBlocking::new(writer) } diff --git a/tracing-appender/src/non_blocking.rs b/tracing-appender/src/non_blocking.rs index 1ac2ba54a1..fe43ecc0af 100644 --- a/tracing-appender/src/non_blocking.rs +++ b/tracing-appender/src/non_blocking.rs @@ -146,11 +146,11 @@ impl NonBlocking { /// /// [default]: NonBlockingBuilder::default /// [builder]: NonBlockingBuilder - pub fn new(writer: T) -> (NonBlocking, WorkerGuard) { + pub fn new(writer: T) -> (NonBlocking, WorkerGuard) { NonBlockingBuilder::default().finish(writer) } - fn create( + fn create( writer: T, buffered_lines_limit: usize, is_lossy: bool, @@ -221,7 +221,7 @@ impl NonBlockingBuilder { } /// Completes the builder, returning the configured `NonBlocking`. - pub fn finish(self, writer: T) -> (NonBlocking, WorkerGuard) { + pub fn finish(self, writer: T) -> (NonBlocking, WorkerGuard) { NonBlocking::create( writer, self.buffered_lines_limit, diff --git a/tracing-appender/src/worker.rs b/tracing-appender/src/worker.rs index e913183edd..00a7d38d3d 100644 --- a/tracing-appender/src/worker.rs +++ b/tracing-appender/src/worker.rs @@ -4,7 +4,7 @@ use std::fmt::Debug; use std::io::Write; use std::{io, thread}; -pub(crate) struct Worker { +pub(crate) struct Worker { writer: T, receiver: Receiver, shutdown: Receiver<()>, @@ -18,7 +18,7 @@ pub(crate) enum WorkerState { Shutdown, } -impl Worker { +impl Worker { pub(crate) fn new(receiver: Receiver, writer: T, shutdown: Receiver<()>) -> Worker { Self { writer, From 346d6e6456aa9d62e2b3443b934c153589aa9444 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=B8ren=20Mortensen?= Date: Thu, 19 Oct 2023 18:44:00 +0100 Subject: [PATCH 03/10] core: fix incorrect (incorrectly updated) docs for LevelFilter (#2767) These docs were updated (in response to #1669), but the "or equal to" phrase should have been moved to the other case. Fixes: #1993 ## Motivation When these docs were updated in response to #1669, they were updated incompletely (a level that is equal to a filter is _enabled_, not _disabled_) and therefore remained incorrect. ## Solution The docs were updated, moving the "or equal to" phrase to the other case. --- tracing-core/src/metadata.rs | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/tracing-core/src/metadata.rs b/tracing-core/src/metadata.rs index 5e475c1294..7d8448b641 100644 --- a/tracing-core/src/metadata.rs +++ b/tracing-core/src/metadata.rs @@ -222,10 +222,9 @@ pub struct Level(LevelInner); /// A filter comparable to a verbosity [`Level`]. /// -/// If a [`Level`] is considered less than a `LevelFilter`, it should be -/// considered enabled; if greater than or equal to the `LevelFilter`, -/// that level is disabled. See [`LevelFilter::current`] for more -/// details. +/// If a [`Level`] is considered less than or equal to a `LevelFilter`, it +/// should be considered enabled; if greater than the `LevelFilter`, that level +/// is disabled. See [`LevelFilter::current`] for more details. /// /// Note that this is essentially identical to the `Level` type, but with the /// addition of an [`OFF`] level that completely disables all trace From 119f91a85cb6a8bc797fcf53d91c7719be0d0ee2 Mon Sep 17 00:00:00 2001 From: Gabriel Goller Date: Fri, 20 Oct 2023 19:01:19 +0200 Subject: [PATCH 04/10] tracing: removed core imports in macros (#2762) When a user has a crate named `core`, it can cause issues because our crates import from `::core::*`. Now we are importing from `$crate::__macro_support::*` and there will be no more name clashes. --- tracing/src/lib.rs | 5 +++- tracing/src/macros.rs | 56 +++++++++++++++++++++---------------------- 2 files changed, 32 insertions(+), 29 deletions(-) diff --git a/tracing/src/lib.rs b/tracing/src/lib.rs index 258cbe5906..041f1c668a 100644 --- a/tracing/src/lib.rs +++ b/tracing/src/lib.rs @@ -984,7 +984,10 @@ pub mod subscriber; pub mod __macro_support { pub use crate::callsite::Callsite; use crate::{subscriber::Interest, Metadata}; - pub use core::concat; + // Re-export the `core` functions that are used in macros. This allows + // a crate to be named `core` and avoid name clashes. + // See here: https://github.com/tokio-rs/tracing/issues/2761 + pub use core::{concat, format_args, iter::Iterator, option::Option}; /// Callsite implementation used by macro-generated code. /// diff --git a/tracing/src/macros.rs b/tracing/src/macros.rs index dba49d169b..676a3a5812 100644 --- a/tracing/src/macros.rs +++ b/tracing/src/macros.rs @@ -627,7 +627,7 @@ macro_rules! event { target: $target, parent: $parent, $lvl, - { message = ::core::format_args!($($arg)+), $($fields)* } + { message = $crate::__macro_support::format_args!($($arg)+), $($fields)* } ) ); (name: $name:expr, target: $target:expr, parent: $parent:expr, $lvl:expr, $($k:ident).+ = $($fields:tt)* ) => ( @@ -678,7 +678,7 @@ macro_rules! event { name: $name, target: $target, $lvl, - { message = ::core::format_args!($($arg)+), $($fields)* } + { message = $crate::__macro_support::format_args!($($arg)+), $($fields)* } ) ); (name: $name:expr, target: $target:expr, $lvl:expr, $($k:ident).+ = $($fields:tt)* ) => ( @@ -736,7 +736,7 @@ macro_rules! event { target: $target, parent: $parent, $lvl, - { message = ::core::format_args!($($arg)+), $($fields)* } + { message = $crate::__macro_support::format_args!($($arg)+), $($fields)* } ) ); (target: $target:expr, parent: $parent:expr, $lvl:expr, $($k:ident).+ = $($fields:tt)* ) => ( @@ -789,7 +789,7 @@ macro_rules! event { name: $name, parent: $parent, $lvl, - { message = ::core::format_args!($($arg)+), $($fields)* } + { message = $crate::__macro_support::format_args!($($arg)+), $($fields)* } ) ); (name: $name:expr, parent: $parent:expr, $lvl:expr, $($k:ident).+ = $($fields:tt)* ) => ( @@ -839,7 +839,7 @@ macro_rules! event { $crate::event!( name: $name, $lvl, - { message = ::core::format_args!($($arg)+), $($fields)* } + { message = $crate::__macro_support::format_args!($($arg)+), $($fields)* } ) ); (name: $name:expr, $lvl:expr, $($k:ident).+ = $($fields:tt)* ) => ( @@ -894,7 +894,7 @@ macro_rules! event { $crate::event!( target: $target, $lvl, - { message = ::core::format_args!($($arg)+), $($fields)* } + { message = $crate::__macro_support::format_args!($($arg)+), $($fields)* } ) ); (target: $target:expr, $lvl:expr, $($k:ident).+ = $($fields:tt)* ) => ( @@ -910,7 +910,7 @@ macro_rules! event { target: module_path!(), parent: $parent, $lvl, - { message = ::core::format_args!($($arg)+), $($fields)* } + { message = $crate::__macro_support::format_args!($($arg)+), $($fields)* } ) ); (parent: $parent:expr, $lvl:expr, $($k:ident).+ = $($field:tt)*) => ( @@ -970,7 +970,7 @@ macro_rules! event { $crate::event!( target: module_path!(), $lvl, - { message = ::core::format_args!($($arg)+), $($fields)* } + { message = $crate::__macro_support::format_args!($($arg)+), $($fields)* } ) ); ( $lvl:expr, { $($fields:tt)* }, $($arg:tt)+ ) => ( @@ -2802,79 +2802,79 @@ macro_rules! valueset { // }; (@ { $(,)* $($out:expr),* }, $next:expr, $($k:ident).+ = ?$val:expr, $($rest:tt)*) => { $crate::valueset!( - @ { $($out),*, (&$next, ::core::option::Option::Some(&debug(&$val) as &dyn Value)) }, + @ { $($out),*, (&$next, $crate::__macro_support::Option::Some(&debug(&$val) as &dyn Value)) }, $next, $($rest)* ) }; (@ { $(,)* $($out:expr),* }, $next:expr, $($k:ident).+ = %$val:expr, $($rest:tt)*) => { $crate::valueset!( - @ { $($out),*, (&$next, ::core::option::Option::Some(&display(&$val) as &dyn Value)) }, + @ { $($out),*, (&$next, $crate::__macro_support::Option::Some(&display(&$val) as &dyn Value)) }, $next, $($rest)* ) }; (@ { $(,)* $($out:expr),* }, $next:expr, $($k:ident).+ = $val:expr, $($rest:tt)*) => { $crate::valueset!( - @ { $($out),*, (&$next, ::core::option::Option::Some(&$val as &dyn Value)) }, + @ { $($out),*, (&$next, $crate::__macro_support::Option::Some(&$val as &dyn Value)) }, $next, $($rest)* ) }; (@ { $(,)* $($out:expr),* }, $next:expr, $($k:ident).+, $($rest:tt)*) => { $crate::valueset!( - @ { $($out),*, (&$next, ::core::option::Option::Some(&$($k).+ as &dyn Value)) }, + @ { $($out),*, (&$next, $crate::__macro_support::Option::Some(&$($k).+ as &dyn Value)) }, $next, $($rest)* ) }; (@ { $(,)* $($out:expr),* }, $next:expr, ?$($k:ident).+, $($rest:tt)*) => { $crate::valueset!( - @ { $($out),*, (&$next, ::core::option::Option::Some(&debug(&$($k).+) as &dyn Value)) }, + @ { $($out),*, (&$next, $crate::__macro_support::Option::Some(&debug(&$($k).+) as &dyn Value)) }, $next, $($rest)* ) }; (@ { $(,)* $($out:expr),* }, $next:expr, %$($k:ident).+, $($rest:tt)*) => { $crate::valueset!( - @ { $($out),*, (&$next, ::core::option::Option::Some(&display(&$($k).+) as &dyn Value)) }, + @ { $($out),*, (&$next, $crate::__macro_support::Option::Some(&display(&$($k).+) as &dyn Value)) }, $next, $($rest)* ) }; (@ { $(,)* $($out:expr),* }, $next:expr, $($k:ident).+ = ?$val:expr) => { $crate::valueset!( - @ { $($out),*, (&$next, ::core::option::Option::Some(&debug(&$val) as &dyn Value)) }, + @ { $($out),*, (&$next, $crate::__macro_support::Option::Some(&debug(&$val) as &dyn Value)) }, $next, ) }; (@ { $(,)* $($out:expr),* }, $next:expr, $($k:ident).+ = %$val:expr) => { $crate::valueset!( - @ { $($out),*, (&$next, ::core::option::Option::Some(&display(&$val) as &dyn Value)) }, + @ { $($out),*, (&$next, $crate::__macro_support::Option::Some(&display(&$val) as &dyn Value)) }, $next, ) }; (@ { $(,)* $($out:expr),* }, $next:expr, $($k:ident).+ = $val:expr) => { $crate::valueset!( - @ { $($out),*, (&$next, ::core::option::Option::Some(&$val as &dyn Value)) }, + @ { $($out),*, (&$next, $crate::__macro_support::Option::Some(&$val as &dyn Value)) }, $next, ) }; (@ { $(,)* $($out:expr),* }, $next:expr, $($k:ident).+) => { $crate::valueset!( - @ { $($out),*, (&$next, ::core::option::Option::Some(&$($k).+ as &dyn Value)) }, + @ { $($out),*, (&$next, $crate::__macro_support::Option::Some(&$($k).+ as &dyn Value)) }, $next, ) }; (@ { $(,)* $($out:expr),* }, $next:expr, ?$($k:ident).+) => { $crate::valueset!( - @ { $($out),*, (&$next, ::core::option::Option::Some(&debug(&$($k).+) as &dyn Value)) }, + @ { $($out),*, (&$next, $crate::__macro_support::Option::Some(&debug(&$($k).+) as &dyn Value)) }, $next, ) }; (@ { $(,)* $($out:expr),* }, $next:expr, %$($k:ident).+) => { $crate::valueset!( - @ { $($out),*, (&$next, ::core::option::Option::Some(&display(&$($k).+) as &dyn Value)) }, + @ { $($out),*, (&$next, $crate::__macro_support::Option::Some(&display(&$($k).+) as &dyn Value)) }, $next, ) }; @@ -2882,40 +2882,40 @@ macro_rules! valueset { // Handle literal names (@ { $(,)* $($out:expr),* }, $next:expr, $k:literal = ?$val:expr, $($rest:tt)*) => { $crate::valueset!( - @ { $($out),*, (&$next, ::core::option::Option::Some(&debug(&$val) as &dyn Value)) }, + @ { $($out),*, (&$next, $crate::__macro_support::Option::Some(&debug(&$val) as &dyn Value)) }, $next, $($rest)* ) }; (@ { $(,)* $($out:expr),* }, $next:expr, $k:literal = %$val:expr, $($rest:tt)*) => { $crate::valueset!( - @ { $($out),*, (&$next, ::core::option::Option::Some(&display(&$val) as &dyn Value)) }, + @ { $($out),*, (&$next, $crate::__macro_support::Option::Some(&display(&$val) as &dyn Value)) }, $next, $($rest)* ) }; (@ { $(,)* $($out:expr),* }, $next:expr, $k:literal = $val:expr, $($rest:tt)*) => { $crate::valueset!( - @ { $($out),*, (&$next, ::core::option::Option::Some(&$val as &dyn Value)) }, + @ { $($out),*, (&$next, $crate::__macro_support::Option::Some(&$val as &dyn Value)) }, $next, $($rest)* ) }; (@ { $(,)* $($out:expr),* }, $next:expr, $k:literal = ?$val:expr) => { $crate::valueset!( - @ { $($out),*, (&$next, ::core::option::Option::Some(&debug(&$val) as &dyn Value)) }, + @ { $($out),*, (&$next, $crate::__macro_support::Option::Some(&debug(&$val) as &dyn Value)) }, $next, ) }; (@ { $(,)* $($out:expr),* }, $next:expr, $k:literal = %$val:expr) => { $crate::valueset!( - @ { $($out),*, (&$next, ::core::option::Option::Some(&display(&$val) as &dyn Value)) }, + @ { $($out),*, (&$next, $crate::__macro_support::Option::Some(&display(&$val) as &dyn Value)) }, $next, ) }; (@ { $(,)* $($out:expr),* }, $next:expr, $k:literal = $val:expr) => { $crate::valueset!( - @ { $($out),*, (&$next, ::core::option::Option::Some(&$val as &dyn Value)) }, + @ { $($out),*, (&$next, $crate::__macro_support::Option::Some(&$val as &dyn Value)) }, $next, ) }; @@ -2963,7 +2963,7 @@ macro_rules! valueset { // Remainder is unparsable, but exists --- must be format args! (@ { $(,)* $($out:expr),* }, $next:expr, $($rest:tt)+) => { - $crate::valueset!(@ { (&$next, ::core::option::Option::Some(&::core::format_args!($($rest)+) as &dyn Value)), $($out),* }, $next, ) + $crate::valueset!(@ { (&$next, $crate::__macro_support::Option::Some(&$crate::__macro_support::format_args!($($rest)+) as &dyn Value)), $($out),* }, $next, ) }; // === entry === @@ -2974,7 +2974,7 @@ macro_rules! valueset { let mut iter = $fields.iter(); $fields.value_set($crate::valueset!( @ { }, - ::core::iter::Iterator::next(&mut iter).expect("FieldSet corrupted (this is a bug)"), + $crate::__macro_support::Iterator::next(&mut iter).expect("FieldSet corrupted (this is a bug)"), $($kvs)+ )) } From 7b594354cf0f7919be6975ac73f0ada9ed54aeee Mon Sep 17 00:00:00 2001 From: Nathaniel Cook Date: Mon, 30 Oct 2023 10:17:54 -0600 Subject: [PATCH 05/10] subcriber: update docs for EnvFilter Builder (#2782) The `from_env` and `try_from_env` methods on the builder had the same documentation. This change updates their docs to correctly describe their difference in behavior. ## Motivation Make the docs more clear, so that users need not look at the source to understand the difference between these two functions. ## Solution Updated the docs Co-authored-by: Eliza Weisman --- tracing-subscriber/src/filter/env/builder.rs | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/tracing-subscriber/src/filter/env/builder.rs b/tracing-subscriber/src/filter/env/builder.rs index 8572647412..8afe117c51 100644 --- a/tracing-subscriber/src/filter/env/builder.rs +++ b/tracing-subscriber/src/filter/env/builder.rs @@ -170,15 +170,16 @@ impl Builder { self.parse_lossy(var) } - /// Returns a new [`EnvFilter`] from the directives in the in the configured - /// environment variable, or an error if the environment variable is not set - /// or contains invalid directives. + /// Returns a new [`EnvFilter`] from the directives in the configured + /// environment variable. If the environment variable is unset, no directive is added. + /// + /// An error is returned if the environment contains invalid directives. pub fn from_env(&self) -> Result { let var = env::var(self.env_var_name()).unwrap_or_default(); self.parse(var).map_err(Into::into) } - /// Returns a new [`EnvFilter`] from the directives in the in the configured + /// Returns a new [`EnvFilter`] from the directives in the configured /// environment variable, or an error if the environment variable is not set /// or contains invalid directives. pub fn try_from_env(&self) -> Result { From 4529182e607d6165a496639e006a476edb6b7409 Mon Sep 17 00:00:00 2001 From: Gabriel Goller Date: Mon, 30 Oct 2023 22:13:19 +0100 Subject: [PATCH 06/10] attributes: added missing RecordTypes for instrument (#2781) When using a function annotated with `#[instrument]` it parses the parameters of the function and records them either using `Value` or using `std::fmt::Debug`. There were a few types that implement `Value` but were missing the RecordTypes array. Added them + a unit test for a single one. Fixed: #2775 --- tracing-attributes/src/expand.rs | 5 +++++ tracing-attributes/tests/instrument.rs | 8 +++++--- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/tracing-attributes/src/expand.rs b/tracing-attributes/src/expand.rs index a7123e5239..321f0ce810 100644 --- a/tracing-attributes/src/expand.rs +++ b/tracing-attributes/src/expand.rs @@ -422,10 +422,13 @@ impl RecordType { "i32", "u64", "i64", + "u128", + "i128", "f32", "f64", "usize", "isize", + "String", "NonZeroU8", "NonZeroI8", "NonZeroU16", @@ -434,6 +437,8 @@ impl RecordType { "NonZeroI32", "NonZeroU64", "NonZeroI64", + "NonZeroU128", + "NonZeroI128", "NonZeroUsize", "NonZeroIsize", "Wrapping", diff --git a/tracing-attributes/tests/instrument.rs b/tracing-attributes/tests/instrument.rs index f751eebf69..351ae53e18 100644 --- a/tracing-attributes/tests/instrument.rs +++ b/tracing-attributes/tests/instrument.rs @@ -51,7 +51,7 @@ fn override_everything() { #[test] fn fields() { #[instrument(target = "my_target", level = "debug")] - fn my_fn(arg1: usize, arg2: bool) {} + fn my_fn(arg1: usize, arg2: bool, arg3: String) {} let span = expect::span() .named("my_fn") @@ -68,6 +68,7 @@ fn fields() { expect::field("arg1") .with_value(&2usize) .and(expect::field("arg2").with_value(&false)) + .and(expect::field("arg3").with_value(&"Cool".to_string())) .only(), ), ) @@ -79,6 +80,7 @@ fn fields() { expect::field("arg1") .with_value(&3usize) .and(expect::field("arg2").with_value(&true)) + .and(expect::field("arg3").with_value(&"Still Cool".to_string())) .only(), ), ) @@ -89,8 +91,8 @@ fn fields() { .run_with_handle(); with_default(subscriber, || { - my_fn(2, false); - my_fn(3, true); + my_fn(2, false, "Cool".to_string()); + my_fn(3, true, "Still Cool".to_string()); }); handle.assert_finished(); From c6abc10c3a1b91a4c17d1fb09e081311a5f90eb3 Mon Sep 17 00:00:00 2001 From: David Barsky Date: Mon, 6 Nov 2023 19:07:37 -0500 Subject: [PATCH 07/10] chore: bump MSRV to 1.63 (#2793) --- .github/workflows/CI.yml | 21 +++++---------------- Cargo.toml | 2 +- README.md | 2 +- examples/Cargo.toml | 2 +- tracing-appender/Cargo.toml | 2 +- tracing-appender/README.md | 4 ++-- tracing-appender/src/lib.rs | 4 ++-- tracing-attributes/Cargo.toml | 2 +- tracing-attributes/README.md | 4 ++-- tracing-attributes/src/attr.rs | 9 ++------- tracing-attributes/src/lib.rs | 4 ++-- tracing-core/Cargo.toml | 2 +- tracing-core/README.md | 4 ++-- tracing-core/src/lib.rs | 4 ++-- tracing-error/Cargo.toml | 2 +- tracing-error/README.md | 4 ++-- tracing-error/src/lib.rs | 4 ++-- tracing-flame/Cargo.toml | 2 +- tracing-flame/README.md | 4 ++-- tracing-flame/src/lib.rs | 4 ++-- tracing-futures/Cargo.toml | 2 +- tracing-futures/README.md | 4 ++-- tracing-futures/src/lib.rs | 4 ++-- tracing-journald/Cargo.toml | 2 +- tracing-journald/README.md | 4 ++-- tracing-journald/src/lib.rs | 4 ++-- tracing-log/Cargo.toml | 2 +- tracing-log/README.md | 4 ++-- tracing-log/src/lib.rs | 4 ++-- tracing-macros/Cargo.toml | 2 +- tracing-mock/Cargo.toml | 2 +- tracing-mock/README.md | 4 ++-- tracing-serde/Cargo.toml | 2 +- tracing-serde/README.md | 4 ++-- tracing-serde/src/lib.rs | 4 ++-- tracing-subscriber/Cargo.toml | 2 +- tracing-subscriber/README.md | 4 ++-- tracing-subscriber/src/fmt/mod.rs | 2 +- tracing-subscriber/src/lib.rs | 4 ++-- tracing-tower/Cargo.toml | 2 +- tracing/Cargo.toml | 4 ++-- tracing/README.md | 4 ++-- tracing/src/lib.rs | 4 ++-- tracing/tests/macros.rs | 4 ---- 44 files changed, 72 insertions(+), 92 deletions(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 9d0ffb29de..677cf891ba 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -27,9 +27,9 @@ env: RUSTUP_MAX_RETRIES: 10 # Don't emit giant backtraces in the CI logs. RUST_BACKTRACE: short - MSRV: 1.49.0 + MSRV: 1.63.0 # TODO: remove this once tracing's MSRV is bumped. - APPENDER_MSRV: 1.53.0 + APPENDER_MSRV: 1.63.0 jobs: ### check jobs ### @@ -169,7 +169,7 @@ jobs: shell: bash check-msrv: - # Run `cargo check` on our minimum supported Rust version (1.56.0). This + # Run `cargo check` on our minimum supported Rust version (1.63.0). This # checks with minimal versions; maximal versions are checked above. name: "cargo check (+MSRV -Zminimal-versions)" needs: check @@ -191,7 +191,7 @@ jobs: - tracing-tower - tracing toolchain: - - 1.56.0 + - 1.63.0 - stable steps: - uses: actions/checkout@v3 @@ -316,9 +316,6 @@ jobs: test-features-stable: # Feature flag tests that run on stable Rust. - # TODO(david): once tracing's MSRV goes up to Rust 1.51, we should be able to switch to - # using cargo's V2 feature resolver (https://doc.rust-lang.org/cargo/reference/resolver.html#resolver-versions) - # and avoid cd'ing into each crate's directory. name: cargo test (feature-specific) needs: check runs-on: ubuntu-latest @@ -331,30 +328,22 @@ jobs: override: true - name: "Test log support" run: cargo test - working-directory: "tracing/test-log-support" - name: "Test static max level" run: cargo test - working-directory: "tracing/test_static_max_level_features" - name: "Test static max level (release)" run: cargo test --release - working-directory: "tracing/test_static_max_level_features" - name: "Test tracing-core no-std support" run: cargo test --no-default-features - working-directory: tracing-core - name: "Test tracing no-std support" - run: cargo test --lib --no-default-features - working-directory: tracing + run: cargo test --no-default-features # this skips running doctests under the `--no-default-features` flag, # as rustdoc isn't aware of cargo's feature flags. - name: "Test tracing-subscriber no-std support" run: cargo test --lib --tests --no-default-features - working-directory: tracing-subscriber - name: "Test tracing-subscriber with liballoc only" run: cargo test --lib --tests --no-default-features --features "alloc" - working-directory: tracing-subscriber - name: "Test tracing-subscriber with no default features" run: cargo test --lib --tests --no-default-features --features "std" - working-directory: tracing-subscriber # all required checks except for the main test run (which we only require # specific matrix combinations from) diff --git a/Cargo.toml b/Cargo.toml index d272eef50a..65bb8fd092 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,5 +1,5 @@ [workspace] - +resolver = "2" members = [ "tracing", "tracing-core", diff --git a/README.md b/README.md index 58a841b109..033efdc3f7 100644 --- a/README.md +++ b/README.md @@ -252,7 +252,7 @@ attachment that `Future::instrument` does. ## Supported Rust Versions Tracing is built against the latest stable release. The minimum supported -version is 1.56. The current Tracing version is not guaranteed to build on Rust +version is 1.63. The current Tracing version is not guaranteed to build on Rust versions earlier than the minimum supported version. Tracing follows the same compiler support policies as the rest of the Tokio diff --git a/examples/Cargo.toml b/examples/Cargo.toml index ce38c8ab02..48de191a97 100644 --- a/examples/Cargo.toml +++ b/examples/Cargo.toml @@ -3,7 +3,7 @@ name = "tracing-examples" version = "0.0.0" publish = false edition = "2018" -rust-version = "1.56.0" +rust-version = "1.63.0" [features] default = [] diff --git a/tracing-appender/Cargo.toml b/tracing-appender/Cargo.toml index 97d1e7d0ca..6dda55a3db 100644 --- a/tracing-appender/Cargo.toml +++ b/tracing-appender/Cargo.toml @@ -18,7 +18,7 @@ categories = [ ] keywords = ["logging", "tracing", "file-appender", "non-blocking-writer"] edition = "2018" -rust-version = "1.53.0" +rust-version = "1.63.0" [dependencies] crossbeam-channel = "0.5.6" diff --git a/tracing-appender/README.md b/tracing-appender/README.md index 4eaa1ab91b..6ce974fc43 100644 --- a/tracing-appender/README.md +++ b/tracing-appender/README.md @@ -36,7 +36,7 @@ allows events and spans to be recorded in a non-blocking manner through a dedicated logging thread. It also provides a [`RollingFileAppender`][file_appender] that can be used with _or_ without the non-blocking writer. -*Compiler support: [requires `rustc` 1.53+][msrv]* +*Compiler support: [requires `rustc` 1.63+][msrv]* [msrv]: #supported-rust-versions @@ -146,7 +146,7 @@ fn main() { ## Supported Rust Versions `tracing-appender` is built against the latest stable release. The minimum supported -version is 1.53. The current `tracing-appender` version is not guaranteed to build on +version is 1.63. The current `tracing-appender` version is not guaranteed to build on Rust versions earlier than the minimum supported version. Tracing follows the same compiler support policies as the rest of the Tokio diff --git a/tracing-appender/src/lib.rs b/tracing-appender/src/lib.rs index 4964e89ac9..11c9682119 100644 --- a/tracing-appender/src/lib.rs +++ b/tracing-appender/src/lib.rs @@ -7,7 +7,7 @@ //! a dedicated logging thread. It also provides a [`RollingFileAppender`][file_appender] that can //! be used with _or_ without the non-blocking writer. //! -//! *Compiler support: [requires `rustc` 1.53+][msrv]* +//! *Compiler support: [requires `rustc` 1.63+][msrv]* //! //! [msrv]: #supported-rust-versions //! [file_appender]: rolling::RollingFileAppender @@ -124,7 +124,7 @@ //! ## Supported Rust Versions //! //! `tracing-appender` is built against the latest stable release. The minimum supported -//! version is 1.53. The current `tracing-appender` version is not guaranteed to build on +//! version is 1.63. The current `tracing-appender` version is not guaranteed to build on //! Rust versions earlier than the minimum supported version. //! //! Tracing follows the same compiler support policies as the rest of the Tokio diff --git a/tracing-attributes/Cargo.toml b/tracing-attributes/Cargo.toml index 5bac47a1ed..60e575984c 100644 --- a/tracing-attributes/Cargo.toml +++ b/tracing-attributes/Cargo.toml @@ -28,7 +28,7 @@ keywords = ["logging", "tracing", "macro", "instrument", "log"] license = "MIT" readme = "README.md" edition = "2018" -rust-version = "1.56.0" +rust-version = "1.63.0" [lib] proc-macro = true diff --git a/tracing-attributes/README.md b/tracing-attributes/README.md index f14dbb62be..5d69a91c99 100644 --- a/tracing-attributes/README.md +++ b/tracing-attributes/README.md @@ -37,7 +37,7 @@ structured, event-based diagnostic information. This crate provides the Note that this macro is also re-exported by the main `tracing` crate. -*Compiler support: [requires `rustc` 1.56+][msrv]* +*Compiler support: [requires `rustc` 1.63+][msrv]* [msrv]: #supported-rust-versions @@ -69,7 +69,7 @@ pub fn my_function(my_arg: usize) { ## Supported Rust Versions Tracing is built against the latest stable release. The minimum supported -version is 1.56. The current Tracing version is not guaranteed to build on Rust +version is 1.63. The current Tracing version is not guaranteed to build on Rust versions earlier than the minimum supported version. Tracing follows the same compiler support policies as the rest of the Tokio diff --git a/tracing-attributes/src/attr.rs b/tracing-attributes/src/attr.rs index f5ad409398..8b4526164b 100644 --- a/tracing-attributes/src/attr.rs +++ b/tracing-attributes/src/attr.rs @@ -268,19 +268,14 @@ impl Parse for Skips { } } -#[derive(Clone, Debug, Hash, PartialEq, Eq)] +#[derive(Clone, Debug, Hash, PartialEq, Eq, Default)] pub(crate) enum FormatMode { + #[default] Default, Display, Debug, } -impl Default for FormatMode { - fn default() -> Self { - FormatMode::Default - } -} - #[derive(Clone, Debug)] pub(crate) struct Fields(pub(crate) Punctuated); diff --git a/tracing-attributes/src/lib.rs b/tracing-attributes/src/lib.rs index 4a88040246..83b5bb6b68 100644 --- a/tracing-attributes/src/lib.rs +++ b/tracing-attributes/src/lib.rs @@ -6,7 +6,7 @@ //! //! Note that this macro is also re-exported by the main `tracing` crate. //! -//! *Compiler support: [requires `rustc` 1.56+][msrv]* +//! *Compiler support: [requires `rustc` 1.63+][msrv]* //! //! [msrv]: #supported-rust-versions //! @@ -41,7 +41,7 @@ //! ## Supported Rust Versions //! //! Tracing is built against the latest stable release. The minimum supported -//! version is 1.56. The current Tracing version is not guaranteed to build on +//! version is 1.63. The current Tracing version is not guaranteed to build on //! Rust versions earlier than the minimum supported version. //! //! Tracing follows the same compiler support policies as the rest of the Tokio diff --git a/tracing-core/Cargo.toml b/tracing-core/Cargo.toml index a9ed02f2e6..03663ae1b6 100644 --- a/tracing-core/Cargo.toml +++ b/tracing-core/Cargo.toml @@ -24,7 +24,7 @@ categories = [ ] keywords = ["logging", "tracing", "profiling"] edition = "2018" -rust-version = "1.56.0" +rust-version = "1.63.0" [features] default = ["std", "valuable/std"] diff --git a/tracing-core/README.md b/tracing-core/README.md index 36559489e9..ae6fa8e37f 100644 --- a/tracing-core/README.md +++ b/tracing-core/README.md @@ -53,7 +53,7 @@ The crate provides: In addition, it defines the global callsite registry and per-thread current dispatcher which other components of the tracing system rely on. -*Compiler support: [requires `rustc` 1.56+][msrv]* +*Compiler support: [requires `rustc` 1.63+][msrv]* [msrv]: #supported-rust-versions @@ -99,7 +99,7 @@ The following crate feature flags are available: ## Supported Rust Versions Tracing is built against the latest stable release. The minimum supported -version is 1.56. The current Tracing version is not guaranteed to build on Rust +version is 1.63. The current Tracing version is not guaranteed to build on Rust versions earlier than the minimum supported version. Tracing follows the same compiler support policies as the rest of the Tokio diff --git a/tracing-core/src/lib.rs b/tracing-core/src/lib.rs index d43a6b8b04..95621e7e54 100644 --- a/tracing-core/src/lib.rs +++ b/tracing-core/src/lib.rs @@ -23,7 +23,7 @@ //! In addition, it defines the global callsite registry and per-thread current //! dispatcher which other components of the tracing system rely on. //! -//! *Compiler support: [requires `rustc` 1.56+][msrv]* +//! *Compiler support: [requires `rustc` 1.63+][msrv]* //! //! [msrv]: #supported-rust-versions //! @@ -92,7 +92,7 @@ //! ## Supported Rust Versions //! //! Tracing is built against the latest stable release. The minimum supported -//! version is 1.56. The current Tracing version is not guaranteed to build on +//! version is 1.63. The current Tracing version is not guaranteed to build on //! Rust versions earlier than the minimum supported version. //! //! Tracing follows the same compiler support policies as the rest of the Tokio diff --git a/tracing-error/Cargo.toml b/tracing-error/Cargo.toml index fb09c64eb6..170d827689 100644 --- a/tracing-error/Cargo.toml +++ b/tracing-error/Cargo.toml @@ -32,7 +32,7 @@ keywords = [ "backtrace" ] edition = "2018" -rust-version = "1.56.0" +rust-version = "1.63.0" [features] default = ["traced-error"] diff --git a/tracing-error/README.md b/tracing-error/README.md index 11427aca6a..f129a56f62 100644 --- a/tracing-error/README.md +++ b/tracing-error/README.md @@ -48,7 +48,7 @@ The crate provides the following: **Note**: This crate is currently experimental. -*Compiler support: [requires `rustc` 1.56+][msrv]* +*Compiler support: [requires `rustc` 1.63+][msrv]* [msrv]: #supported-rust-versions @@ -186,7 +186,7 @@ fn main() { ## Supported Rust Versions Tracing is built against the latest stable release. The minimum supported -version is 1.56. The current Tracing version is not guaranteed to build on Rust +version is 1.63. The current Tracing version is not guaranteed to build on Rust versions earlier than the minimum supported version. Tracing follows the same compiler support policies as the rest of the Tokio diff --git a/tracing-error/src/lib.rs b/tracing-error/src/lib.rs index 55a04d9026..1fc37f66ac 100644 --- a/tracing-error/src/lib.rs +++ b/tracing-error/src/lib.rs @@ -18,7 +18,7 @@ //! //! **Note**: This crate is currently experimental. //! -//! *Compiler support: [requires `rustc` 1.56+][msrv]* +//! *Compiler support: [requires `rustc` 1.63+][msrv]* //! //! [msrv]: #supported-rust-versions //! @@ -167,7 +167,7 @@ //! ## Supported Rust Versions //! //! Tracing is built against the latest stable release. The minimum supported -//! version is 1.56. The current Tracing version is not guaranteed to build on +//! version is 1.63. The current Tracing version is not guaranteed to build on //! Rust versions earlier than the minimum supported version. //! //! Tracing follows the same compiler support policies as the rest of the Tokio diff --git a/tracing-flame/Cargo.toml b/tracing-flame/Cargo.toml index 2153a0b787..81ea126cfa 100644 --- a/tracing-flame/Cargo.toml +++ b/tracing-flame/Cargo.toml @@ -19,7 +19,7 @@ categories = [ "asynchronous", ] keywords = ["tracing", "subscriber", "flamegraph", "profiling"] -rust-version = "1.56.0" +rust-version = "1.63.0" [features] default = ["smallvec"] diff --git a/tracing-flame/README.md b/tracing-flame/README.md index d1bcd267ed..7722a0b371 100644 --- a/tracing-flame/README.md +++ b/tracing-flame/README.md @@ -26,7 +26,7 @@ flamegraph/flamechart. Flamegraphs/flamecharts are useful for identifying perfor bottlenecks in an application. For more details, see Brendan Gregg's [post] on flamegraphs. -*Compiler support: [requires `rustc` 1.56+][msrv]* +*Compiler support: [requires `rustc` 1.63+][msrv]* [msrv]: #supported-rust-versions [post]: http://www.brendangregg.com/flamegraphs.html @@ -106,7 +106,7 @@ _flamechart_, which _does not_ sort or collapse identical stack frames. ## Supported Rust Versions Tracing is built against the latest stable release. The minimum supported -version is 1.56. The current Tracing version is not guaranteed to build on Rust +version is 1.63. The current Tracing version is not guaranteed to build on Rust versions earlier than the minimum supported version. Tracing follows the same compiler support policies as the rest of the Tokio diff --git a/tracing-flame/src/lib.rs b/tracing-flame/src/lib.rs index a4731dd154..d9b2c54c26 100644 --- a/tracing-flame/src/lib.rs +++ b/tracing-flame/src/lib.rs @@ -10,7 +10,7 @@ //! issues bottlenecks in an application. For more details, see Brendan Gregg's [post] //! on flamegraphs. //! -//! *Compiler support: [requires `rustc` 1.56+][msrv]* +//! *Compiler support: [requires `rustc` 1.63+][msrv]* //! //! [msrv]: #supported-rust-versions //! [post]: http://www.brendangregg.com/flamegraphs.html @@ -95,7 +95,7 @@ //! ## Supported Rust Versions //! //! Tracing is built against the latest stable release. The minimum supported -//! version is 1.56. The current Tracing version is not guaranteed to build on +//! version is 1.63. The current Tracing version is not guaranteed to build on //! Rust versions earlier than the minimum supported version. //! //! Tracing follows the same compiler support policies as the rest of the Tokio diff --git a/tracing-futures/Cargo.toml b/tracing-futures/Cargo.toml index efc87eb248..5dc17394b7 100644 --- a/tracing-futures/Cargo.toml +++ b/tracing-futures/Cargo.toml @@ -16,7 +16,7 @@ categories = [ ] keywords = ["logging", "profiling", "tracing", "futures", "async"] license = "MIT" -rust-version = "1.56.0" +rust-version = "1.63.0" [features] default = ["std-future", "std"] diff --git a/tracing-futures/README.md b/tracing-futures/README.md index e2f0da6bd8..bc1c833b73 100644 --- a/tracing-futures/README.md +++ b/tracing-futures/README.md @@ -51,14 +51,14 @@ The crate provides the following traits: [`Subscriber`]: https://docs.rs/tracing/latest/tracing/subscriber/index.html [`tracing`]: https://crates.io/crates/tracing -*Compiler support: [requires `rustc` 1.56+][msrv]* +*Compiler support: [requires `rustc` 1.63+][msrv]* [msrv]: #supported-rust-versions ## Supported Rust Versions Tracing is built against the latest stable release. The minimum supported -version is 1.56. The current Tracing version is not guaranteed to build on Rust +version is 1.63. The current Tracing version is not guaranteed to build on Rust versions earlier than the minimum supported version. Tracing follows the same compiler support policies as the rest of the Tokio diff --git a/tracing-futures/src/lib.rs b/tracing-futures/src/lib.rs index c79e748a0d..185b2363b3 100644 --- a/tracing-futures/src/lib.rs +++ b/tracing-futures/src/lib.rs @@ -15,7 +15,7 @@ //! * [`WithSubscriber`] allows a `tracing` [`Subscriber`] to be attached to a //! future, sink, stream, or executor. //! -//! *Compiler support: [requires `rustc` 1.56+][msrv]* +//! *Compiler support: [requires `rustc` 1.63+][msrv]* //! //! [msrv]: #supported-rust-versions //! @@ -59,7 +59,7 @@ //! ## Supported Rust Versions //! //! Tracing is built against the latest stable release. The minimum supported -//! version is 1.56. The current Tracing version is not guaranteed to build on +//! version is 1.63. The current Tracing version is not guaranteed to build on //! Rust versions earlier than the minimum supported version. //! //! Tracing follows the same compiler support policies as the rest of the Tokio diff --git a/tracing-journald/Cargo.toml b/tracing-journald/Cargo.toml index f6944f1ca7..2ccbb1d39d 100644 --- a/tracing-journald/Cargo.toml +++ b/tracing-journald/Cargo.toml @@ -13,7 +13,7 @@ categories = [ "development-tools::profiling", ] keywords = ["tracing", "journald"] -rust-version = "1.56.0" +rust-version = "1.63.0" [dependencies] libc = "0.2.126" diff --git a/tracing-journald/README.md b/tracing-journald/README.md index 58211c7d41..133c2095e4 100644 --- a/tracing-journald/README.md +++ b/tracing-journald/README.md @@ -28,7 +28,7 @@ scoped, structured, and async-aware diagnostics. `tracing-journald` provides a and events to [`systemd-journald`][journald], on Linux distributions that use `systemd`. -*Compiler support: [requires `rustc` 1.56+][msrv]* +*Compiler support: [requires `rustc` 1.63+][msrv]* [msrv]: #supported-rust-versions [`tracing`]: https://crates.io/crates/tracing @@ -38,7 +38,7 @@ and events to [`systemd-journald`][journald], on Linux distributions that use ## Supported Rust Versions Tracing is built against the latest stable release. The minimum supported -version is 1.56. The current Tracing version is not guaranteed to build on Rust +version is 1.63. The current Tracing version is not guaranteed to build on Rust versions earlier than the minimum supported version. Tracing follows the same compiler support policies as the rest of the Tokio diff --git a/tracing-journald/src/lib.rs b/tracing-journald/src/lib.rs index 10c6f1b974..d7229af801 100644 --- a/tracing-journald/src/lib.rs +++ b/tracing-journald/src/lib.rs @@ -11,7 +11,7 @@ //! and events to [`systemd-journald`][journald], on Linux distributions that //! use `systemd`. //! -//! *Compiler support: [requires `rustc` 1.56+][msrv]* +//! *Compiler support: [requires `rustc` 1.63+][msrv]* //! //! [msrv]: #supported-rust-versions //! [`tracing`]: https://crates.io/crates/tracing @@ -20,7 +20,7 @@ //! ## Supported Rust Versions //! //! Tracing is built against the latest stable release. The minimum supported -//! version is 1.56. The current Tracing version is not guaranteed to build on +//! version is 1.63. The current Tracing version is not guaranteed to build on //! Rust versions earlier than the minimum supported version. //! //! Tracing follows the same compiler support policies as the rest of the Tokio diff --git a/tracing-log/Cargo.toml b/tracing-log/Cargo.toml index 0b7bfa5214..b622b05fcf 100644 --- a/tracing-log/Cargo.toml +++ b/tracing-log/Cargo.toml @@ -15,7 +15,7 @@ categories = [ keywords = ["logging", "tracing", "log"] license = "MIT" readme = "README.md" -rust-version = "1.56.0" +rust-version = "1.63.0" [features] default = ["log-tracer", "std"] diff --git a/tracing-log/README.md b/tracing-log/README.md index 267ce7b7f0..2e009b4e00 100644 --- a/tracing-log/README.md +++ b/tracing-log/README.md @@ -54,14 +54,14 @@ This crate provides: [`tracing::Subscriber`]: https://docs.rs/tracing/latest/tracing/trait.Subscriber.html [`tracing::Event`]: https://docs.rs/tracing/latest/tracing/struct.Event.html -*Compiler support: [requires `rustc` 1.56+][msrv]* +*Compiler support: [requires `rustc` 1.63+][msrv]* [msrv]: #supported-rust-versions ## Supported Rust Versions Tracing is built against the latest stable release. The minimum supported -version is 1.56. The current Tracing version is not guaranteed to build on Rust +version is 1.63. The current Tracing version is not guaranteed to build on Rust versions earlier than the minimum supported version. Tracing follows the same compiler support policies as the rest of the Tokio diff --git a/tracing-log/src/lib.rs b/tracing-log/src/lib.rs index bb162d9e14..77b35a89df 100644 --- a/tracing-log/src/lib.rs +++ b/tracing-log/src/lib.rs @@ -14,7 +14,7 @@ //! - [`LogTracer`], a [`log::Log`] implementation that consumes [`log::Record`]s //! and outputs them as [`tracing::Event`]. //! -//! *Compiler support: [requires `rustc` 1.56+][msrv]* +//! *Compiler support: [requires `rustc` 1.63+][msrv]* //! //! [msrv]: #supported-rust-versions //! @@ -75,7 +75,7 @@ //! ## Supported Rust Versions //! //! Tracing is built against the latest stable release. The minimum supported -//! version is 1.56. The current Tracing version is not guaranteed to build on +//! version is 1.63. The current Tracing version is not guaranteed to build on //! Rust versions earlier than the minimum supported version. //! //! Tracing follows the same compiler support policies as the rest of the Tokio diff --git a/tracing-macros/Cargo.toml b/tracing-macros/Cargo.toml index 59424170de..f0d1ff7896 100644 --- a/tracing-macros/Cargo.toml +++ b/tracing-macros/Cargo.toml @@ -15,7 +15,7 @@ categories = [ ] keywords = ["logging", "tracing"] license = "MIT" -rust-version = "1.56.0" +rust-version = "1.63.0" [dependencies] tracing = { path = "../tracing", version = "0.1.35" } diff --git a/tracing-mock/Cargo.toml b/tracing-mock/Cargo.toml index 5cfca82b12..c87cf6524e 100644 --- a/tracing-mock/Cargo.toml +++ b/tracing-mock/Cargo.toml @@ -14,7 +14,7 @@ readme = "README.md" repository = "https://github.com/tokio-rs/tracing" homepage = "https://tokio.rs" edition = "2018" -rust-version = "1.56.0" +rust-version = "1.63.0" publish = false [dependencies] diff --git a/tracing-mock/README.md b/tracing-mock/README.md index c3adff3dab..299a737534 100644 --- a/tracing-mock/README.md +++ b/tracing-mock/README.md @@ -29,7 +29,7 @@ structured, event-based diagnostic information. `tracing-mock` provides tools for making assertions about what `tracing` diagnostics are emitted by code under test. -*Compiler support: [requires `rustc` 1.56+][msrv]* +*Compiler support: [requires `rustc` 1.63+][msrv]* [msrv]: #supported-rust-versions @@ -154,7 +154,7 @@ handle.assert_finished(); ## Supported Rust Versions Tracing is built against the latest stable release. The minimum supported -version is 1.56. The current Tracing version is not guaranteed to build on Rust +version is 1.63. The current Tracing version is not guaranteed to build on Rust versions earlier than the minimum supported version. Tracing follows the same compiler support policies as the rest of the Tokio diff --git a/tracing-serde/Cargo.toml b/tracing-serde/Cargo.toml index e9670906bb..b3bab80eb4 100644 --- a/tracing-serde/Cargo.toml +++ b/tracing-serde/Cargo.toml @@ -16,7 +16,7 @@ categories = [ "encoding", ] keywords = ["logging", "tracing", "serialization"] -rust-version = "1.56.0" +rust-version = "1.63.0" [features] valuable = ["valuable_crate", "valuable-serde", "tracing-core/valuable"] diff --git a/tracing-serde/README.md b/tracing-serde/README.md index 3f1cc82afa..87c0f1e68c 100644 --- a/tracing-serde/README.md +++ b/tracing-serde/README.md @@ -36,7 +36,7 @@ and tracing data to monitor your services in production. The `tracing` crate provides the APIs necessary for instrumenting libraries and applications to emit trace data. -*Compiler support: [requires `rustc` 1.56+][msrv]* +*Compiler support: [requires `rustc` 1.63+][msrv]* [msrv]: #supported-rust-versions @@ -97,7 +97,7 @@ trace data. ## Supported Rust Versions Tracing is built against the latest stable release. The minimum supported -version is 1.56. The current Tracing version is not guaranteed to build on Rust +version is 1.63. The current Tracing version is not guaranteed to build on Rust versions earlier than the minimum supported version. Tracing follows the same compiler support policies as the rest of the Tokio diff --git a/tracing-serde/src/lib.rs b/tracing-serde/src/lib.rs index 211feb80f6..15cd2f7511 100644 --- a/tracing-serde/src/lib.rs +++ b/tracing-serde/src/lib.rs @@ -32,7 +32,7 @@ //! The `tracing` crate provides the APIs necessary for instrumenting //! libraries and applications to emit trace data. //! -//! *Compiler support: [requires `rustc` 1.56+][msrv]* +//! *Compiler support: [requires `rustc` 1.63+][msrv]* //! //! [msrv]: #supported-rust-versions //! @@ -142,7 +142,7 @@ //! ## Supported Rust Versions //! //! Tracing is built against the latest stable release. The minimum supported -//! version is 1.56. The current Tracing version is not guaranteed to build on +//! version is 1.63. The current Tracing version is not guaranteed to build on //! Rust versions earlier than the minimum supported version. //! //! Tracing follows the same compiler support policies as the rest of the Tokio diff --git a/tracing-subscriber/Cargo.toml b/tracing-subscriber/Cargo.toml index 1473e7a6b8..49580e4271 100644 --- a/tracing-subscriber/Cargo.toml +++ b/tracing-subscriber/Cargo.toml @@ -20,7 +20,7 @@ categories = [ "asynchronous", ] keywords = ["logging", "tracing", "metrics", "subscriber"] -rust-version = "1.56.0" +rust-version = "1.63.0" [features] diff --git a/tracing-subscriber/README.md b/tracing-subscriber/README.md index f1b7a03f2f..cc5426d04d 100644 --- a/tracing-subscriber/README.md +++ b/tracing-subscriber/README.md @@ -32,14 +32,14 @@ Utilities for implementing and composing [`tracing`][tracing] subscribers. [discord-url]: https://discord.gg/EeF3cQw [maint-badge]: https://img.shields.io/badge/maintenance-experimental-blue.svg -*Compiler support: [requires `rustc` 1.56+][msrv]* +*Compiler support: [requires `rustc` 1.63+][msrv]* [msrv]: #supported-rust-versions ## Supported Rust Versions Tracing is built against the latest stable release. The minimum supported -version is 1.56. The current Tracing version is not guaranteed to build on Rust +version is 1.63. The current Tracing version is not guaranteed to build on Rust versions earlier than the minimum supported version. Tracing follows the same compiler support policies as the rest of the Tokio diff --git a/tracing-subscriber/src/fmt/mod.rs b/tracing-subscriber/src/fmt/mod.rs index 163b56da3f..3762164132 100644 --- a/tracing-subscriber/src/fmt/mod.rs +++ b/tracing-subscriber/src/fmt/mod.rs @@ -16,7 +16,7 @@ //! tracing-subscriber = "0.3" //! ``` //! -//! *Compiler support: [requires `rustc` 1.56+][msrv]* +//! *Compiler support: [requires `rustc` 1.63+][msrv]* //! //! [msrv]: super#supported-rust-versions //! diff --git a/tracing-subscriber/src/lib.rs b/tracing-subscriber/src/lib.rs index 3ff8e3e591..21cfe70dee 100644 --- a/tracing-subscriber/src/lib.rs +++ b/tracing-subscriber/src/lib.rs @@ -10,7 +10,7 @@ //! `tracing-subscriber` is intended for use by both `Subscriber` authors and //! application authors using `tracing` to instrument their applications. //! -//! *Compiler support: [requires `rustc` 1.56+][msrv]* +//! *Compiler support: [requires `rustc` 1.63+][msrv]* //! //! [msrv]: #supported-rust-versions //! @@ -138,7 +138,7 @@ //! ## Supported Rust Versions //! //! Tracing is built against the latest stable release. The minimum supported -//! version is 1.56. The current Tracing version is not guaranteed to build on +//! version is 1.63. The current Tracing version is not guaranteed to build on //! Rust versions earlier than the minimum supported version. //! //! Tracing follows the same compiler support policies as the rest of the Tokio diff --git a/tracing-tower/Cargo.toml b/tracing-tower/Cargo.toml index 80923c82d8..8e958e2d05 100644 --- a/tracing-tower/Cargo.toml +++ b/tracing-tower/Cargo.toml @@ -15,7 +15,7 @@ categories = [ ] keywords = ["logging", "tracing"] license = "MIT" -rust-version = "1.56.0" +rust-version = "1.63.0" [features] default = ["tower-layer", "tower-make"] diff --git a/tracing/Cargo.toml b/tracing/Cargo.toml index 52ea9c08c4..bcad05c640 100644 --- a/tracing/Cargo.toml +++ b/tracing/Cargo.toml @@ -25,7 +25,7 @@ categories = [ ] keywords = ["logging", "tracing", "metrics", "async"] edition = "2018" -rust-version = "1.56.0" +rust-version = "1.63.0" [dependencies] tracing-core = { path = "../tracing-core", version = "0.1.32", default-features = false } @@ -40,7 +40,7 @@ log = "0.4.17" tracing-mock = { path = "../tracing-mock" } [target.'cfg(target_arch = "wasm32")'.dev-dependencies] -wasm-bindgen-test = "^0.3" +wasm-bindgen-test = "0.3.38" [features] default = ["std", "attributes"] diff --git a/tracing/README.md b/tracing/README.md index a42636f336..c9ab85e104 100644 --- a/tracing/README.md +++ b/tracing/README.md @@ -47,7 +47,7 @@ data as well as textual messages. The `tracing` crate provides the APIs necessary for instrumenting libraries and applications to emit trace data. -*Compiler support: [requires `rustc` 1.56+][msrv]* +*Compiler support: [requires `rustc` 1.63+][msrv]* [msrv]: #supported-rust-versions @@ -445,7 +445,7 @@ undergoing active development. They may be less stable than `tracing` and ## Supported Rust Versions Tracing is built against the latest stable release. The minimum supported -version is 1.56. The current Tracing version is not guaranteed to build on Rust +version is 1.63. The current Tracing version is not guaranteed to build on Rust versions earlier than the minimum supported version. Tracing follows the same compiler support policies as the rest of the Tokio diff --git a/tracing/src/lib.rs b/tracing/src/lib.rs index 041f1c668a..52dd971de8 100644 --- a/tracing/src/lib.rs +++ b/tracing/src/lib.rs @@ -19,7 +19,7 @@ //! The `tracing` crate provides the APIs necessary for instrumenting libraries //! and applications to emit trace data. //! -//! *Compiler support: [requires `rustc` 1.56+][msrv]* +//! *Compiler support: [requires `rustc` 1.63+][msrv]* //! //! [msrv]: #supported-rust-versions //! # Core Concepts @@ -871,7 +871,7 @@ //! ## Supported Rust Versions //! //! Tracing is built against the latest stable release. The minimum supported -//! version is 1.56. The current Tracing version is not guaranteed to build on +//! version is 1.63. The current Tracing version is not guaranteed to build on //! Rust versions earlier than the minimum supported version. //! //! Tracing follows the same compiler support policies as the rest of the Tokio diff --git a/tracing/tests/macros.rs b/tracing/tests/macros.rs index 81b929d1d3..b6e568f4a6 100644 --- a/tracing/tests/macros.rs +++ b/tracing/tests/macros.rs @@ -5,10 +5,6 @@ extern crate tracing; #[cfg(target_arch = "wasm32")] extern crate wasm_bindgen_test; -// TODO: remove this once https://github.com/tokio-rs/tracing/pull/2675#issuecomment-1667628907 is resolved -#[cfg(target_arch = "wasm32")] -use ::core::option::Option::None; - use tracing::{ callsite, debug, debug_span, enabled, error, error_span, event, event_enabled, info, info_span, span, span_enabled, trace, trace_span, warn, warn_span, Level, From abb23931ef496902e241c39f67a8ed03e8ebbcca Mon Sep 17 00:00:00 2001 From: David Barsky Date: Mon, 6 Nov 2023 20:03:57 -0500 Subject: [PATCH 08/10] chore: backport CI improvements (#2238) --- .github/workflows/CI.yml | 154 ++++++++++++++------------------------- 1 file changed, 55 insertions(+), 99 deletions(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 677cf891ba..fc79d0965a 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -3,7 +3,6 @@ name: CI on: push: branches: - - master - "v0.1.x" pull_request: {} @@ -27,9 +26,6 @@ env: RUSTUP_MAX_RETRIES: 10 # Don't emit giant backtraces in the CI logs. RUST_BACKTRACE: short - MSRV: 1.63.0 - # TODO: remove this once tracing's MSRV is bumped. - APPENDER_MSRV: 1.63.0 jobs: ### check jobs ### @@ -40,16 +36,9 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 - - uses: actions-rs/toolchain@v1 - with: - toolchain: stable - profile: minimal - override: true + - uses: dtolnay/rust-toolchain@stable - name: Check - uses: actions-rs/cargo@v1 - with: - command: check - args: --all --tests --benches + run: cargo check --all --tests --benches style: # Check style. @@ -58,17 +47,11 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 - - uses: actions-rs/toolchain@v1 + - uses: dtolnay/rust-toolchain@stable with: - toolchain: stable components: rustfmt - profile: minimal - override: true - name: rustfmt - uses: actions-rs/cargo@v1 - with: - command: fmt - args: --all -- --check + run: cargo fmt --all -- --check warnings: # Check for any warnings. This is informational and thus is allowed to fail. @@ -76,46 +59,15 @@ jobs: needs: check steps: - uses: actions/checkout@v3 - - uses: actions-rs/toolchain@v1 + - uses: dtolnay/rust-toolchain@stable with: - toolchain: stable components: clippy - profile: minimal - name: Clippy uses: actions-rs/clippy-check@v1 with: token: ${{ secrets.GITHUB_TOKEN }} args: --all --examples --tests --benches -- -D warnings - minimal-versions: - # Check for minimal-versions errors where a dependency is too - # underconstrained to build on the minimal supported version of all - # dependencies in the dependency graph. - name: cargo check (-Zminimal-versions) - needs: check - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - uses: actions-rs/toolchain@v1 - with: - toolchain: nightly - profile: minimal - override: true - - name: install cargo-hack - uses: taiki-e/install-action@cargo-hack - - name: "check --all-features -Z minimal-versions" - run: | - # Remove dev-dependencies from Cargo.toml to prevent the next `cargo update` - # from determining minimal versions based on dev-dependencies. - cargo hack --remove-dev-deps --workspace - # Update Cargo.lock to minimal version dependencies. - cargo update -Z minimal-versions - cargo hack check \ - --package tracing \ - --package tracing-core \ - --package tracing-subscriber \ - --all-features --ignore-private - cargo-hack: needs: check name: cargo check (feature combinations) @@ -195,28 +147,47 @@ jobs: - stable steps: - uses: actions/checkout@v3 - - name: "install Rust ${{ env.APPENDER_MSRV }}" - uses: actions-rs/toolchain@v1 - with: - toolchain: ${{ env.APPENDER_MSRV }} - profile: minimal - - name: "install Rust nightly" - uses: actions-rs/toolchain@v1 + - name: install Rust nightly + uses: dtolnay/rust-toolchain@nightly + - name: "install Rust ${{ matrix.toolchain }}" + uses: dtolnay/rust-toolchain@master with: - toolchain: nightly - profile: minimal - - name: Select minimal versions - uses: actions-rs/cargo@v1 - with: - command: update - args: -Z minimal-versions - toolchain: nightly - - name: Check - uses: actions-rs/cargo@v1 - with: - command: check - args: --all-features --locked -p tracing-appender - toolchain: ${{ env.APPENDER_MSRV }} + toolchain: ${{ matrix.toolchain }} + - name: install cargo-hack + uses: taiki-e/install-action@cargo-hack + - name: install cargo-minimal-versions + uses: taiki-e/install-action@cargo-minimal-versions + - name: cargo minimal-versions check + working-directory: ${{ matrix.subcrate }} + # tracing and tracing-subscriber have too many features to be checked by + # cargo-hack --feature-powerset with all features in the powerset, so + # exclude some + run: | + CARGO_MINVER=(cargo minimal-versions check --feature-powerset --no-dev-deps) + case "${{ matrix.subcrate }}" in + tracing) + EXCLUDE_FEATURES=( + max_level_off max_level_error max_level_warn max_level_info + max_level_debug max_level_trace release_max_level_off + release_max_level_error release_max_level_warn + release_max_level_info release_max_level_debug + release_max_level_trace + ) + ${CARGO_MINVER[@]} --exclude-features "${EXCLUDE_FEATURES[*]}" + ;; + tracing-subscriber) + INCLUDE_FEATURES=(fmt ansi json registry env-filter) + ${CARGO_MINVER[@]} --include-features "${INCLUDE_FEATURES[*]}" + ;; + tracing-futures) + EXCLUDE_FEATURES=(futures-01 futures_01 tokio tokio_01) + ${CARGO_MINVER[@]} --exclude-features "${EXCLUDE_FEATURES[*]}" + ;; + *) + ${CARGO_MINVER[@]} + ;; + esac + shell: bash ### test jobs ############################################################# @@ -240,11 +211,10 @@ jobs: runs-on: ${{ matrix.os }} steps: - uses: actions/checkout@v3 - - uses: actions-rs/toolchain@v1 + - name: "install Rust ${{ matrix.rust }}" + uses: dtolnay/rust-toolchain@master with: toolchain: ${{ matrix.rust }} - profile: minimal - override: true - name: install cargo-nextest uses: taiki-e/install-action@nextest - name: Run tests @@ -283,16 +253,11 @@ jobs: fail-fast: false steps: - uses: actions/checkout@v3 - - uses: actions-rs/toolchain@v1 + - uses: dtolnay/rust-toolchain@stable with: target: wasm32-unknown-unknown - toolchain: stable - override: true - name: build all tests - uses: actions-rs/cargo@v1 - with: - command: test - args: --no-run -p ${{ matrix.subcrate }} + run: cargo test --no-run -p ${{ matrix.subcrate }} test-wasm: name: cargo test (wasm) @@ -304,11 +269,9 @@ jobs: - tracing steps: - uses: actions/checkout@v3 - - uses: actions-rs/toolchain@v1 + - uses: dtolnay/rust-toolchain@stable with: target: wasm32-unknown-unknown - toolchain: stable - override: true - name: install test runner for wasm uses: taiki-e/install-action@wasm-pack - name: run wasm tests @@ -321,29 +284,23 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 - - uses: actions-rs/toolchain@v1 - with: - toolchain: stable - profile: minimal - override: true + - uses: dtolnay/rust-toolchain@stable - name: "Test log support" run: cargo test - name: "Test static max level" run: cargo test + working-directory: "tracing/test_static_max_level_features" - name: "Test static max level (release)" run: cargo test --release + working-directory: "tracing/test_static_max_level_features" - name: "Test tracing-core no-std support" run: cargo test --no-default-features - name: "Test tracing no-std support" run: cargo test --no-default-features # this skips running doctests under the `--no-default-features` flag, # as rustdoc isn't aware of cargo's feature flags. - - name: "Test tracing-subscriber no-std support" + - name: "Test tracing-subscriber with all features disabled" run: cargo test --lib --tests --no-default-features - - name: "Test tracing-subscriber with liballoc only" - run: cargo test --lib --tests --no-default-features --features "alloc" - - name: "Test tracing-subscriber with no default features" - run: cargo test --lib --tests --no-default-features --features "std" # all required checks except for the main test run (which we only require # specific matrix combinations from) @@ -352,11 +309,10 @@ jobs: runs-on: ubuntu-latest needs: - style - - minimal-versions - cargo-hack - check-msrv - test-build-wasm - test-wasm - test-features-stable steps: - - run: exit 0 + - run: exit 0 \ No newline at end of file From 1dc1e6a302dd13e0c4de5e18c7a119970c9571a8 Mon Sep 17 00:00:00 2001 From: David Barsky Date: Mon, 6 Nov 2023 20:20:20 -0500 Subject: [PATCH 09/10] chore: bump `ahash` to 0.7.7 (#2794) --- tracing-log/Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tracing-log/Cargo.toml b/tracing-log/Cargo.toml index b622b05fcf..dad4cf366d 100644 --- a/tracing-log/Cargo.toml +++ b/tracing-log/Cargo.toml @@ -28,7 +28,7 @@ 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.6", optional = true } +ahash = { version = "0.7.7", optional = true } [dev-dependencies] tracing = { path = "../tracing", version = "0.1.35"} From befb4de073acc8a228d6ad041088e6332253e8de Mon Sep 17 00:00:00 2001 From: David Barsky Date: Tue, 7 Nov 2023 16:48:45 -0500 Subject: [PATCH 10/10] chore: fix `ahash`-caused build breakage (#2792) This branch _should_ fix the CI issues caused by https://github.com/tkaitchuck/aHash/issues/163. (We can't move to 0.8.5 for MSRV reasons.) Co-authored-by: Eliza Weisman