-
-
Notifications
You must be signed in to change notification settings - Fork 7
feat!: Use env_logger for output #800
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
base: main
Are you sure you want to change the base?
Conversation
|
Needs #799 for the CI, and I have to take a look where the nightly test is failing exactly |
| where | ||
| F: FnOnce() -> String, | ||
| { | ||
| if VERBOSE { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was actually using generics to create two versions, one with the printlns disabled. that did save a bunch of time when I tested it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It really wouldn't surprise me if I accidentally removed a bit too much here.
| pub(crate) fn maybe_set_limit(limit: usize, verbose: u8) { | ||
| pub(crate) fn maybe_set_limit(limit: usize) { | ||
| JOBSERVER.get_or_init(|| { | ||
| if verbose > 1 { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this was using >1, so maybe trace?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed in 56bfb21
|
A number of |
Well, maybe keep changing output method and changing output content separately. I did make laze output |
That's what I assumed the reason was for the prefix. I do think it should be applied consistently, otherwise messages that do not have the prefix might confuse the reader of the origin.
An opt out of the prefix? Should be possible to add in a follow up.
I already removed a 'warn' in the output content here and there, because that's duplicate now. |
|
Output should now be identical to current main. |
|
| Branch | pr/logger |
| Testbed | github-actions |
Click to view all benchmark results
| Benchmark | perf:task-clock | Benchmark Result msec x 1e3 (Result Δ%) | Upper Boundary msec x 1e3 (Limit %) |
|---|---|---|---|
| laze -C RIOT build --global --generate-only | 📈 view plot 🚷 view threshold | 9.34 x 1e3(-1.07%)Baseline: 9.44 x 1e3 | 9.94 x 1e3 (94.01%) |
This refactors all (non-commented)
println!s to use a logger viaenv_logger. This allows for setting the log level via environment variables and retains the filtering of the messages via the command line arguments (--verboseand--quiet).A lot of the code is simplified because the
verboseargument doesn't have to be passed around in most cases.