-
Notifications
You must be signed in to change notification settings - Fork 831
Open
Labels
crate/subscriberRelated to the `tracing-subscriber` crateRelated to the `tracing-subscriber` cratekind/featureNew feature or requestNew feature or requestmeta/breakingThis is a breaking change, and should wait until the next breaking release.This is a breaking change, and should wait until the next breaking release.
Milestone
Description
Feature Request
Crates
none
Motivation
Doing anything dynamic can get pretty hairy:
let builder = SubscriberBuilder::builder();
if something {
builder = builder.json();
} else {
builder = builder.compact();
}
Proposal
Make the various builders use functions of the form: fn foo(&mut self, arg: T) -> &mut Self
Alternative
Could accept a with_x
for every option so at least re-assignment on conditionals could be worked around (there's nothing for Format
currently)
Is there a reason why we can't do this? Why consume self
for each step in the build.
I'm happy to implement this change if it's something you're interested in.
torsteingrindvik, mplanchard, dinhani, b-zee, frederikhors and 3 morefrederikhorsfrederikhors
Metadata
Metadata
Assignees
Labels
crate/subscriberRelated to the `tracing-subscriber` crateRelated to the `tracing-subscriber` cratekind/featureNew feature or requestNew feature or requestmeta/breakingThis is a breaking change, and should wait until the next breaking release.This is a breaking change, and should wait until the next breaking release.