-
Notifications
You must be signed in to change notification settings - Fork 742
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
docs: Remove misleading comment about RUST_LOG #2994
base: master
Are you sure you want to change the base?
Conversation
This comment describes a behavior that's not true. Unless you configure an `EnvFilter`, the global collector will not respect `RUST_LOG`. I've opted to remove the comment since the surrounding context is only the minimal intro of the crate, instead of adding more information that requires more context right at the introduction of the crate. Closes tokio-rs#2993
Thanks for the PR. The issue underlying issue is that |
Oh goodness. 🤦 Thank you for pointing that out. With the former syntax, is there a way to still instantiate things like the |
Before anything else, I should emphasize that I'm sorry that this was your early/first experience with Rust: it took me several minutes of fiddling in a local repo to figure out what was happening and my name is in the authors array of this crate!
The short answer is "not really"; the longer answer is "depends on if you're okay with chaining some method calls". To expand on the latter, both Stepping back, I think we'd want to:
@abatilo As a person who just ran into this issue/new to Rust, what's your initial gut feeling? Is removing some of these |
I appreciate the warm welcome and extremely fast responses from contributors to this repo! The frustration at least turned into a great learning experience. My recent background is almost entirely in Go where JSON structured logging seems more common, relatively speaking. For what it's worth, here's how I instantiate my favorite logging library with a bare minimum:
There is no default/built in ability to source a logging level from an environment variable as far as I know. We're left to implement that ourselves. With my biases in consideration, I actually think I was just more confused than anything that there appears to be so many ways to setup a logger. I don't personally mind one bit if the instantiation is very verbose, but having more of a golden path would be quite nice. Let me know if that doesn't quite answer your questions though, but if I'm understanding you correctly, I would be in favor of removing the init methods and keep the longer approach if it means more uniformity. |
👍
That did answer my question, thank you! I too would prefer a single, golden path for setting up a subscriber/logger: we've let this garden of options grow to be a little untended and confusing. I just wasn't sure if there's a point at which you (or any other user!) would find the code to be way too noisy and bounce off entirely. It seems to me that we're not at that threshold yet. |
I want to throw in my 2 cents after using this crate. (BTW thanks for the quality work). I would prefer if there were two options to initialize tracing
So normal non-power users or new users, who just want to get things started, could use Option 2 to quickly get it working. Later if requirements change, they could replace with option 1 with more control over the process. |
This comment describes a behavior that's not true. Unless you configure
an
EnvFilter
, the global collector will not respectRUST_LOG
.I've opted to remove the comment since the surrounding context is only
the minimal intro of the crate, instead of adding more information that
requires more context right at the introduction of the crate.
Closes #2993