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

Use NGF logger in client-go library #2618

Merged
merged 1 commit into from
Sep 27, 2024

Conversation

sjberman
Copy link
Contributor

Problem: The klog logger used by client-go has different formatting than the NGF loggers.

Solution: Set the klog logger to wrap the NGF logger and therefore use the same formatting.

Testing: Verified that client-go log messages now fit our formatting.

Closes #1101

Checklist

Before creating a PR, run through this checklist and mark each as complete.

  • I have read the CONTRIBUTING doc
  • I have added tests that prove my fix is effective or that my feature works
  • I have checked that all unit tests pass after adding my changes
  • I have updated necessary documentation
  • I have rebased my branch onto main
  • I will ensure my PR is targeting the main branch and pulling from my branch from my own fork

Release notes

If this PR introduces a change that affects users and needs to be mentioned in the release notes,
please add a brief note that summarizes the change.

NONE

Problem: The klog logger used by client-go has different formatting than the NGF loggers.

Solution: Set the klog logger to wrap the NGF logger and therefore use the same formatting.
@sjberman sjberman requested review from a team as code owners September 27, 2024 16:00
@github-actions github-actions bot added documentation Improvements or additions to documentation dependencies Pull requests that update a dependency file chore Pull requests for routine tasks labels Sep 27, 2024
@sjberman
Copy link
Contributor Author

For example, before:

Screenshot 2024-09-27 at 10 01 47 AM

and after:

Screenshot 2024-09-27 at 10 02 24 AM

Copy link

codecov bot commented Sep 27, 2024

Codecov Report

Attention: Patch coverage is 0% with 1 line in your changes missing coverage. Please review.

Project coverage is 88.61%. Comparing base (900c877) to head (725f4a4).
Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
cmd/gateway/commands.go 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2618      +/-   ##
==========================================
- Coverage   88.62%   88.61%   -0.02%     
==========================================
  Files         105      105              
  Lines        8109     8110       +1     
  Branches       50       50              
==========================================
  Hits         7187     7187              
- Misses        865      866       +1     
  Partials       57       57              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Member

@lucacome lucacome left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚀

@sjberman sjberman merged commit 433eba2 into nginxinc:main Sep 27, 2024
37 of 38 checks passed
@sjberman sjberman deleted the chore/log-improvements branch September 27, 2024 18:29
salonichf5 pushed a commit that referenced this pull request Oct 8, 2024
Problem: The klog logger used by client-go has different formatting than the NGF loggers.

Solution: Set the klog logger to wrap the NGF logger and therefore use the same formatting.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
chore Pull requests for routine tasks dependencies Pull requests that update a dependency file documentation Improvements or additions to documentation
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

Use NGF Logger in Client-Go Library
3 participants