Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add console_without_tokio_unstable to make tokio_unstable assertion optional #446

Merged
merged 2 commits into from
Aug 24, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions console-subscriber/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,13 @@ tracing_subscriber::registry()
[`tokio-console`]: https://github.com/tokio-rs/console
[Tokio]: https://tokio.rs

### Using other runtimes

If you are using a custom runtime that supports tokio-console, you may not need
to enable the `tokio_unstable` cfg flag. In this case, you need to enable cfg
`console_without_tokio_unstable` for console-subscriber to disable its check for
`tokio_unstable`.

### Crate Feature Flags

This crate provides the following feature flags and optional dependencies:
Expand Down
2 changes: 1 addition & 1 deletion console-subscriber/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,7 @@ impl ConsoleLayer {
// depending on the build-time configuration...
#![allow(clippy::assertions_on_constants)]
assert!(
cfg!(tokio_unstable),
cfg!(any(tokio_unstable, console_without_tokio_unstable)),
"task tracing requires Tokio to be built with RUSTFLAGS=\"--cfg tokio_unstable\"!"
);

Expand Down