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

Consistency between various *default methods #455

Open
jonhoo opened this issue Nov 26, 2019 · 1 comment · May be fixed by #1051
Open

Consistency between various *default methods #455

jonhoo opened this issue Nov 26, 2019 · 1 comment · May be fixed by #1051
Labels
crate/core Related to the `tracing-core` crate meta/breaking This is a breaking change, and should wait until the next breaking release.

Comments

@jonhoo
Copy link
Contributor

jonhoo commented Nov 26, 2019

Feature Request

  • tracing::dispatcher::set_default takes &Dispatch
  • tracing::dispatcher::set_global_default takes Dispatch
  • tracing::dispatcher::with_default takes &Dispatch

These should all take one or the other. &Dispatch is definitely more ergonomic (and we clone internally), Dispatch saves us a clone in certain cases. Either way, we should stick with one.

@hawkw
Copy link
Member

hawkw commented Dec 19, 2019

Unfortunately, I think this is a breaking change. So, we can do it, but it'll have to wait until the next time we break APIs in tracing-core (which may not be for a while)...

@hawkw hawkw added the crate/core Related to the `tracing-core` crate label Dec 19, 2019
@hawkw hawkw added this to the tracing-core 0.2 milestone Dec 19, 2019
@hawkw hawkw added the meta/breaking This is a breaking change, and should wait until the next breaking release. label Mar 11, 2020
dvdplm added a commit to dvdplm/tracing that referenced this issue Oct 16, 2020
This changes `set_global_default` to take a reference to its `Dispatch` for a more consistent API at the cost of a one-time clone when initializing the `GLOBAL_DISPATCH` static.

Closes tokio-rs#455
Part of tokio-rs#922
dvdplm added a commit to dvdplm/tracing that referenced this issue Oct 16, 2020
…spatch-as-ref-tokio-rs#455

* upstream/master: (28 commits)
  opentelemetry: prepare for 0.8.0 release (tokio-rs#1036)
  docs: add favicon for extra pretty docs (tokio-rs#1033)
  subscriber: fix `reload` ergonomics (tokio-rs#1035)
  chore(deps): update crossbeam-channel requirement from 0.4.2 to 0.5.0 (tokio-rs#1031)
  opentelemetry: Assign default ids if missing (tokio-rs#1027)
  chore: remove deprecated add-path from CI (tokio-rs#1026)
  attributes:  fix `#[instrument(err)]` in case of early returns (tokio-rs#1006)
  core: remove mandatory liballoc dependency with no-std (tokio-rs#1017)
  chore(deps): update cfg-if requirement from 0.1.10 to 1.0.0 (tokio-rs#1023)
  subscriber: warn if trying to enable a statically disabled level (tokio-rs#990)
  subscriber: use macros for module declarations (tokio-rs#1009)
  chore: remove `stdlib.rs` (tokio-rs#1008)
  core: fix linked list tests reusing `Registration`s (tokio-rs#1016)
  subscriber: support dash in target names (tokio-rs#1012)
  docs: switch to intra-doc links in tracing-core (tokio-rs#1010)
  tracing-opentelemetry: implement additional record types (bool, i64, u64) (tokio-rs#1007)
  core: add intrusive linked list for callsite registry (tokio-rs#988)
  serde: allow tracing-serde to work on no_std. (tokio-rs#960)
  tracing: remove `Into<Option<Id>>` impl for `Span` (tokio-rs#1003)
  tracing: make `Entered` `!Send` (tokio-rs#1001)
  ...
dvdplm added a commit to dvdplm/tracing that referenced this issue Oct 19, 2020
As an alternative to tokio-rs#1045, this PR switches `set_default` and `with_default` to take an owned `Dispatch` instead of a ref.

See [comment here](tokio-rs#1045 (comment)) for motivation.

Closes tokio-rs#455
Part of tokio-rs#922
@dvdplm dvdplm linked a pull request Oct 19, 2020 that will close this issue
dvdplm added a commit to dvdplm/tracing that referenced this issue Oct 22, 2020
…spatch-as-owned-tokio-rs#455

* upstream/master: (34 commits)
  subscriber: remove TraceLogger (tokio-rs#1052)
  subscriber: make Registry::enter/exit much faster (tokio-rs#1058)
  chore(deps): update env_logger requirement from 0.7 to 0.8 (tokio-rs#1050)
  chore: fix tracing-macros::dbg (tokio-rs#1054)
  chore(deps): update pin-project requirement from 0.4 to 1.0 (tokio-rs#1038)
  chore: remove duplicated section from tracing/README.md (tokio-rs#1046)
  opentelemetry: prepare for 0.8.0 release (tokio-rs#1036)
  docs: add favicon for extra pretty docs (tokio-rs#1033)
  subscriber: fix `reload` ergonomics (tokio-rs#1035)
  chore(deps): update crossbeam-channel requirement from 0.4.2 to 0.5.0 (tokio-rs#1031)
  opentelemetry: Assign default ids if missing (tokio-rs#1027)
  chore: remove deprecated add-path from CI (tokio-rs#1026)
  attributes:  fix `#[instrument(err)]` in case of early returns (tokio-rs#1006)
  core: remove mandatory liballoc dependency with no-std (tokio-rs#1017)
  chore(deps): update cfg-if requirement from 0.1.10 to 1.0.0 (tokio-rs#1023)
  subscriber: warn if trying to enable a statically disabled level (tokio-rs#990)
  subscriber: use macros for module declarations (tokio-rs#1009)
  chore: remove `stdlib.rs` (tokio-rs#1008)
  core: fix linked list tests reusing `Registration`s (tokio-rs#1016)
  subscriber: support dash in target names (tokio-rs#1012)
  ...
dvdplm added a commit to dvdplm/tracing that referenced this issue Oct 22, 2020
…spatch-as-ref-tokio-rs#455

* upstream/master:
  subscriber: remove TraceLogger (tokio-rs#1052)
  subscriber: make Registry::enter/exit much faster (tokio-rs#1058)
  chore(deps): update env_logger requirement from 0.7 to 0.8 (tokio-rs#1050)
  chore: fix tracing-macros::dbg (tokio-rs#1054)
  chore(deps): update pin-project requirement from 0.4 to 1.0 (tokio-rs#1038)
  chore: remove duplicated section from tracing/README.md (tokio-rs#1046)
dvdplm added a commit to dvdplm/tracing that referenced this issue Oct 23, 2020
…spatch-as-owned-tokio-rs#455

* upstream/master:
  subscriber: update sharded-slab to 0.1, pool hashmap allocations (tokio-rs#1062)
  subscriber: remove deprecated type, structs, and methods tokio-rs#1030
  core: rename Subscriber to Collect (tokio-rs#1015)
  chore: fix rustdoc warning in tracing-subscriber (tokio-rs#1061)
dvdplm added a commit to dvdplm/tracing that referenced this issue Oct 28, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
crate/core Related to the `tracing-core` crate meta/breaking This is a breaking change, and should wait until the next breaking release.
Projects
None yet
2 participants