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

Dispatcher::none() and NoSubscriber have no effect when set per-thread #2016

Closed
g2p opened this issue Mar 24, 2022 · 1 comment
Closed

Dispatcher::none() and NoSubscriber have no effect when set per-thread #2016

g2p opened this issue Mar 24, 2022 · 1 comment

Comments

@g2p
Copy link

g2p commented Mar 24, 2022

The dispatch logic ignores NoSubscriber when it is the thread-local subscriber.

Having the default per-thread subscriber forward to the global subscriber makes sense, but should use a purpose-built sentinel value. Otherwise NoSubscriber isn't usable and doesn't work as documented (with_subscriber, set_subscriber, with_dispatcher, set_dispatcher all work at the thread level and won't have the desired effect).

Discovered while working on tokio-rs/console#314.

@g2p
Copy link
Author

g2p commented Mar 24, 2022

Ah, reported in #1999 and fixed in #2001.

(I was mystified that NoSubscriber didn't work ever since tokio-console 0.1)

@g2p g2p closed this as completed Mar 24, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant