From bbb8f25a666a4e15de3c5054244e228a51b5c7c0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=BA=8C=E6=89=8B=E6=8E=89=E5=8C=85=E5=B7=A5=E7=A8=8B?= =?UTF-8?q?=E5=B8=88?= Date: Tue, 7 Feb 2023 02:44:53 +0800 Subject: [PATCH] fix(subscriber): bump minimum Tokio version (#397) Fixes #386 Signed-off-by: hi-rustin --- console-subscriber/Cargo.toml | 2 +- console-subscriber/README.md | 15 +++++++++------ 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/console-subscriber/Cargo.toml b/console-subscriber/Cargo.toml index cbead40f7..3ed323c32 100644 --- a/console-subscriber/Cargo.toml +++ b/console-subscriber/Cargo.toml @@ -32,7 +32,7 @@ env-filter = ["tracing-subscriber/env-filter"] [dependencies] crossbeam-utils = "0.8.7" -tokio = { version = "^1.15", features = ["sync", "time", "macros", "tracing"] } +tokio = { version = "^1.21", features = ["sync", "time", "macros", "tracing"] } tokio-stream = "0.1" thread_local = "1.1.3" console-api = { version = "0.4.0", path = "../console-api", features = ["transport"] } diff --git a/console-subscriber/README.md b/console-subscriber/README.md index 9d9e5224c..01c5c05e0 100644 --- a/console-subscriber/README.md +++ b/console-subscriber/README.md @@ -78,7 +78,7 @@ runtime][Tokio] is considered *experimental*. In order to use ``` If you're using a workspace, you should put the `.cargo/config.toml` file in the root of your workspace. Otherwise, put the `.cargo/config.toml` file in the root directory of your crate. - + Putting `.cargo/config.toml` files below the workspace or crate root directory may lead to tools like Rust-Analyzer or VSCode not using your `.cargo/config.toml` since they invoke cargo from the workspace or crate root and cargo only looks for the `.cargo` directory in the current & parent directories. @@ -101,9 +101,9 @@ runtime][Tokio] is considered *experimental*. In order to use [`EnvFilter`] or [`Targets`] filters from [`tracing-subscriber`], add `"tokio=trace,runtime=trace"` to your filter configuration. - + Also, ensure you have not enabled any of the [compile time filter + + Also, ensure you have not enabled any of the [compile time filter features][compile_time_filters] in your `Cargo.toml`. - + #### Required Tokio Versions Because instrumentation for different aspects of the runtime is being added to @@ -111,7 +111,7 @@ Tokio over time, the latest Tokio release is generally *recommended* to access a the console's functionality. However, it should generally be compatible with earlier Tokio versions, although some information may not be available. A minimum version of [Tokio v1.0.0] or later is required to use the console's -task instrumentation. +task instrumentation. Other instrumentation is added in later Tokio releases: @@ -126,8 +126,10 @@ Other instrumentation is added in later Tokio releases: * [Tokio v1.15.0] or later is required to track [`tokio::sync`] resources, such as `Mutex`es, `RwLock`s, `Semaphore`s, `oneshot` channels, `mpsc` channels, et - cetera. - + cetera. + +* [Tokio v1.21.0] or later is required to use newest `task::Builder::spawn*` APIs. + [Tokio v1.0.0]: https://github.com/tokio-rs/tokio/releases/tag/tokio-1.0.0 [Tokio v1.7.0]: https://github.com/tokio-rs/tokio/releases/tag/tokio-1.7.0 [Tokio v1.12.0]:https://github.com/tokio-rs/tokio/releases/tag/tokio-1.12.0 @@ -144,6 +146,7 @@ Other instrumentation is added in later Tokio releases: [builder]: https://docs.rs/console-subscriber/latest/console_subscriber/struct.Builder.html [init]: https://docs.rs/console-subscriber/latest/console_subscriber/fn.init.html [compile_time_filters]: https://docs.rs/tracing/latest/tracing/level_filters/index.html#compile-time-filters +[Tokio v1.21.0]: https://github.com/tokio-rs/tokio/releases/tag/tokio-1.21.0 ### Adding the Console Subscriber