-
Notifications
You must be signed in to change notification settings - Fork 169
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
Use zerolog
instead of log
#766
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Exposes a `--log-level` arg on every command Replaces all `log` uses with either `fmt.Fprint(os.Stderr)` or zerolog calls Benefits: - Rather than mixing actual logs (that should have a level) and things that we want to print to stderr, using zerolog and fmt is more deliberate in meaning - Logs can be disabled or turned on using the `--log-level` option - We'll be able to add more verbose logs without potentially annoying people. An example is the "Loading environment" messages that the export command now prints. I shifted that to debug - Will allow for trace level logs. Ex: #751, logs from the underlying `kubectl` exec or helm
Benchstat (compared to main):
|
zzehring
approved these changes
Sep 28, 2022
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.
LGTM
Duologic
approved these changes
Sep 29, 2022
julienduchesne
added a commit
that referenced
this pull request
Sep 30, 2022
Follow-up to #766 - Shift linting name logging to debug logging. Instead of sending everything to stdout, we can now have a cleaner "report" - Missed some `log.Printf`(alias for Debug) in helm code, shifted that to info logs - Added some caching logs, whether or not it's a cache hit + time elasped to calculate hash - Changed `time` for `duration_ms` in env loading log. This conflicts with the log time
julienduchesne
added a commit
that referenced
this pull request
Sep 30, 2022
Follow-up to #766 - Shift linting name logging to debug logging. Instead of sending everything to stdout, we can now have a cleaner "report" - Missed some `log.Printf`(alias for Debug) in helm code, shifted that to info logs - Added some caching logs, whether or not it's a cache hit + time elasped to calculate hash - Changed `time` for `duration_ms` in env loading log. This conflicts with the log time
julienduchesne
added a commit
that referenced
this pull request
Oct 3, 2022
Follow-up to #766 - Shift linting name logging to debug logging. Instead of sending everything to stdout, we can now have a cleaner "report" - Missed some `log.Printf`(alias for Debug) in helm code, shifted that to info logs - Added some caching logs, whether or not it's a cache hit + time elasped to calculate hash - Changed `time` for `duration_ms` in env loading log. This conflicts with the log time
jvrplmlmn
reviewed
Oct 5, 2022
Comment on lines
-56
to
+74
log.Fatalln(color.RedString("Error:"), err) | ||
fmt.Fprintln(os.Stderr, "Error:", err) |
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.
Seems like this change makes it so that if there is any errors, we don't exit (1).
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Exposes a
--log-level
arg on every commandReplaces all
log
uses with eitherfmt.Fprint(os.Stderr)
or zerolog callsBenefits:
--log-level
optionkubectl
exec or helm