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

Static Analyzer: require log.WithError instead of log.Errorf("bad: %v", err) #11143

Merged
merged 9 commits into from
Aug 1, 2022

Conversation

prestonvanloon
Copy link
Member

What type of PR is this?

Other

What does this PR do? Why is it needed?

This is a follow up to #11116 where I mentioned that I would be adding enforcement to use log.WithError() instead of templated log messages.

In this PR, I have implemented the static analysis check and appropriate test. I have not enabled this check in the codebase yet as it would make this PR very large.
Enabling the check and fixing the dozens of templated log statements with errors will follow in another PR.

Which issues(s) does this PR fix?

Fixes #

Other notes for review

@prestonvanloon prestonvanloon marked this pull request as ready for review August 1, 2022 15:08
@prestonvanloon prestonvanloon requested a review from a team as a code owner August 1, 2022 15:08
@prylabs-bulldozer prylabs-bulldozer bot merged commit d17826f into develop Aug 1, 2022
@delete-merged-branch delete-merged-branch bot deleted the logruswitherror branch August 1, 2022 16:08
@rkapka
Copy link
Contributor

rkapka commented Aug 1, 2022

Nice!

prylabs-bulldozer bot added a commit that referenced this pull request Aug 5, 2022
…1163)

* Use log.WithError static analysis from #11143 and fix all violations

* Fix another log violation after pulling from develop

* Update beacon-chain/sync/pending_blocks_queue.go

Co-authored-by: Potuz <potuz@prysmaticlabs.com>

* @potuz feedback

* Copy paste fail

* fix tests

Co-authored-by: prylabs-bulldozer[bot] <58059840+prylabs-bulldozer[bot]@users.noreply.github.com>
Co-authored-by: Potuz <potuz@prysmaticlabs.com>
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.

2 participants