Skip to content

Rename tracing_subscriber::layer::Layer to something closer to Subscriber. #641

@davidbarsky

Description

@davidbarsky

Feature Request

Crates

  • tracing-subscriber

Motivation

"Layer" is a somewhat abstract name for describing what it is actually: a composable subscriber. Given the centrality of the Subscriber trait and our direction to end-customers to use the Layer trait as much as possible, I think we should attempt to communicate the "subscriber"-ness of Layer to end-users as much as possible. It would also align the Layer trait closer to the crate's name, tracing-subscriber.

Proposal

(The process for renaming is relatively simple, so most of this proposal will focus on non-tracing-core breaking changes.) Here are a few options:

  • Re-export tracing_core::Subscriber as CoreSubscriber in tracing; rename Layer to Subscriber. Optionally, at some later point, break tracing_core and rename Subscriber to CoreSubscriber. In documentation, emphasize that CoreSubscriber is low-level trait and that tracing_subscriber::Subscriber should be preferred whenever possible.
  • Rename Layer to ComposableSubscriber. I'm not a fan of this option; ComposableSubscriber is a bit of a mouthful.

Alternatives

  • Don't do this.

Metadata

Metadata

Assignees

Labels

crate/coreRelated to the `tracing-core` cratecrate/subscriberRelated to the `tracing-subscriber` cratecrate/tracingRelated to the `tracing` cratekind/rfcA request for comments to discuss future changesmeta/breakingThis is a breaking change, and should wait until the next breaking release.

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions