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

Update other examples to use set_global_default. #184

Merged
merged 1 commit into from
Jul 12, 2019

Conversation

samscott89
Copy link
Contributor

Motivation

Same as in #183, extended to the other examples. When using tokio, need to either use global subscriber, or experimental-tracing tokio feature.

Solution

Use set_global_default in examples.

TODO?

Might be a common mistake people make. Perhaps document this behaviour and reference in the examples somewhere.

@hawkw
Copy link
Member

hawkw commented Jul 12, 2019

TODO?

Might be a common mistake people make. Perhaps document this behaviour and reference in the examples somewhere.

I updated the documentation in #171 to try and highlight this a little better; do you think that's sufficient, or is there anything else we ought to do?

Copy link
Member

@hawkw hawkw left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks, this is great!

@samscott89
Copy link
Contributor Author

TODO?

Might be a common mistake people make. Perhaps document this behaviour and reference in the examples somewhere.

I updated the documentation in #171 to try and highlight this a little better; do you think that's sufficient, or is there anything else we ought to do?

Oh that's really useful information! Makes it a lot clearer.
Perhaps just bumping the visibility a bit, by referencing the section in the part which talks about set_global_default ~> https://docs.rs/tracing/0.1.3/tracing/#in-executables for example?

@hawkw
Copy link
Member

hawkw commented Jul 12, 2019

TODO?

Might be a common mistake people make. Perhaps document this behaviour and reference in the examples somewhere.

I updated the documentation in #171 to try and highlight this a little better; do you think that's sufficient, or is there anything else we ought to do?

Oh that's really useful information! Makes it a lot clearer.
Perhaps just bumping the visibility a bit, by referencing the section in the part which talks about set_global_default ~> https://docs.rs/tracing/0.1.3/tracing/#in-executables for example?

Yeah, that's a good call, we should probably link it there. Feel free to add that, or I'll get to it eventually.

@hawkw hawkw merged commit eb5a643 into tokio-rs:master Jul 12, 2019
@samscott89 samscott89 deleted the examples-use-global branch July 13, 2019 15:14
@samscott89 samscott89 restored the examples-use-global branch July 13, 2019 15:14
@samscott89 samscott89 deleted the examples-use-global branch July 13, 2019 15:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants