-
Notifications
You must be signed in to change notification settings - Fork 464
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
Add logcheck tool #5442
Merged
Merged
Add logcheck tool #5442
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
golangci-lint already executes go vet, why should we run it twice?
These helper functions were not aligned with our logging guideline. When logging objects, callers should simply pass a runtime.Object or client.ObjectKey. Adding object.something is not so nice and inconsistent with the codebase.
76 tasks
/assign |
rfranzke
reviewed
Feb 15, 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.
Kudos, very nice PR! Well done!
rfranzke
approved these changes
Feb 16, 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
acumino
added a commit
to acumino/gardener-extension-provider-aws
that referenced
this pull request
Mar 15, 2022
acumino
added a commit
to acumino/gardener-extension-provider-aws
that referenced
this pull request
Mar 17, 2022
krgostev
pushed a commit
to krgostev/gardener
that referenced
this pull request
Apr 21, 2022
* Document logcheck tool * Implement logcheck tool * Add tests for logcheck tool * Install and execute logcheck golangci-lint plugin * Drop obsolete go vet execution golangci-lint already executes go vet, why should we run it twice? * Remove trailing punction mark from messages * Make keys lowerCamelCase * Make messages captitalized * Remove spaces from keys * Fix odd number of args * Make messages constant string expressions * Drop LogErrAndExit in favor of proper error handling * Drop controller.*EventLogger in favor of proper structured logging These helper functions were not aligned with our logging guideline. When logging objects, callers should simply pass a runtime.Object or client.ObjectKey. Adding object.something is not so nice and inconsistent with the codebase. * Increase readability
krgostev
pushed a commit
to krgostev/gardener
that referenced
this pull request
Jul 5, 2022
* Document logcheck tool * Implement logcheck tool * Add tests for logcheck tool * Install and execute logcheck golangci-lint plugin * Drop obsolete go vet execution golangci-lint already executes go vet, why should we run it twice? * Remove trailing punction mark from messages * Make keys lowerCamelCase * Make messages captitalized * Remove spaces from keys * Fix odd number of args * Make messages constant string expressions * Drop LogErrAndExit in favor of proper error handling * Drop controller.*EventLogger in favor of proper structured logging These helper functions were not aligned with our logging guideline. When logging objects, callers should simply pass a runtime.Object or client.ObjectKey. Adding object.something is not so nice and inconsistent with the codebase. * Increase readability
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
area/dev-productivity
Developer productivity related (how to improve development)
area/logging
Logging related
kind/enhancement
Enhancement, improvement, extension
size/XL
Denotes a PR that changes 500-999 lines, ignoring generated files.
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.
How to categorize this PR?
/area logging dev-productivity
/kind enhancement
What this PR does / why we need it:
Adds the
logcheck
tool, which enforces some parts of the logging guideline and also detects programmer-level errors (e.g. odd number of args).After adding the tool, all reported errors on existing code are resolved.
Which issue(s) this PR fixes:
Part of #4251
Special notes for your reviewer:
Use the dedicated commits! The first 5 commits are about the tooling itself, the others resolve reported errors on existing code.
/squash
I might need to fix some stuff later on to make the tool reusable in extensions, but it's too hard to test and fix with
replace
s and some other go mod quirks.Release note:
A new `logcheck` tool has been added: it aims at making logs across Gardener components more consistent and help detect programmer-level errors early on. Read more about it in the [tool's documentation](https://github.com/gardener/gardener/blob/master/hack/tools/logcheck).