Skip to content

subscriber: Rename tracing_subscriber::registry() to tracing_subscriber::collector() #1040

@davidbarsky

Description

@davidbarsky

Feature Request

Crates

tracing-subscriber.

Proposal

We currently have a top-level tracing_subscriber::registry() function that returns a tracing_subscriber::registry::Registry. Since the renaming tracing_core::Subscriber to tracing_core::Collect rename in #1015, the naming of registry() doesn't feel cohesive with the new style we're settling on for subscribers and collectors (briefly: traits are named Collect and Subscribe; implementations of these traits are module/crate scoped and are called Collector and Subscriber respectively).

We ought rename the tracing_subscriber::registry() function to tracing_subscriber::collector() to enable fluent builder APIs such as:

let collector = tracing_subscriber::collector()
    .with(fmt::subscriber())
    .with(metrics::subscriber());

Alternatives

Don't do this; keep as-is.

Metadata

Metadata

Assignees

No one assigned

    Labels

    crate/subscriberRelated to the `tracing-subscriber` crate

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions