Skip to content

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

Closed
@g2p

Description

@g2p

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions