Skip to content

Commit

Permalink
fix(subscriber): bump minimum Tokio version (#397)
Browse files Browse the repository at this point in the history
Fixes #386

Signed-off-by: hi-rustin <rustin.liu@gmail.com>
  • Loading branch information
Rustin170506 authored and hawkw committed Sep 29, 2023
1 parent 053755c commit bbb8f25
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 7 deletions.
2 changes: 1 addition & 1 deletion console-subscriber/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"] }
Expand Down
15 changes: 9 additions & 6 deletions console-subscriber/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -101,17 +101,17 @@ 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
Tokio over time, the latest Tokio release is generally *recommended* to access all of
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:

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

Expand Down

0 comments on commit bbb8f25

Please sign in to comment.