Skip to content
This repository was archived by the owner on Mar 3, 2025. It is now read-only.

Conversation

@joelanford
Copy link
Member

Use standard klog now that klog works with controller-runtime's expectation of a logr.Logger interface.

We get a standard --v flag and we are more in line with k8s standards.

We also get client-go and other low-level logging from k8s libraries at the higher verbosity levels which could be immensely helpful for debugging.

@codecov
Copy link

codecov bot commented Sep 27, 2024

Codecov Report

Attention: Patch coverage is 0% with 4 lines in your changes missing coverage. Please review.

Project coverage is 35.65%. Comparing base (a0037dd) to head (457adc7).
Report is 2 commits behind head on main.

Files with missing lines Patch % Lines
cmd/manager/main.go 0.00% 2 Missing ⚠️
...rnal/controllers/core/clustercatalog_controller.go 0.00% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #419      +/-   ##
==========================================
+ Coverage   35.56%   35.65%   +0.08%     
==========================================
  Files          14       14              
  Lines         807      805       -2     
==========================================
  Hits          287      287              
+ Misses        474      472       -2     
  Partials       46       46              

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

- --http2-disable
- --upstream=http://127.0.0.1:8080/
- --logtostderr=true
- --v=0
Copy link
Member Author

@joelanford joelanford Sep 27, 2024

Choose a reason for hiding this comment

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

Removing this to help vendors avoid problems if they want to patch in a different log level, which is common in enterprise environments.

Comment on lines +68 to +69
l.Info("reconcile starting")
defer l.Info("reconcile ending")
Copy link
Member Author

Choose a reason for hiding this comment

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

Moving this to the 0 level, so that they continue to be output with the default log level.

@joelanford
Copy link
Member Author

As a test, I manually set --v=8 on the controller and verified that low-level client-go logs were being emitted. 🎉

@joelanford joelanford added this pull request to the merge queue Sep 27, 2024
Merged via the queue into operator-framework:main with commit db8617f Sep 27, 2024
@joelanford joelanford deleted the use-klog branch October 22, 2024 13:03
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants