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 warning log callback in client-go loading rules #117233
Add warning log callback in client-go loading rules #117233
Conversation
This provides a way to consumers use their own custom warning mechanisms instead default klog warning.
/triage accepted |
/cc @yliaog |
Since the previous attempt was reviewed by @yliaog, could you please take a look at this one?. Thanks. |
/assign @liggitt |
|
||
func (handler WarningHandler) Warn(message string) { | ||
if handler == nil { | ||
klog.V(1).Info(message) |
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.
what is the difference in output between klog.Warningf and klog.V(1).Info?
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.
klog.Warning
prints;
W0524 09:11:16.915498 42167 loader.go:142] Config not found:
klog.V(1).Info
prints(only after --verbosity >= 1);
I0524 08:48:15.896816 40664 loader.go:142] Config not found:
/lgtm |
LGTM label has been added. Git tree hash: b16e911e95d0a542efea7ab8ce900681289aff65
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: ardaguclu, liggitt The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Thanks @liggitt. We are lucky that we have you for these portions of the code base. |
* Add warning log callback in client-go loading rules This provides a way to consumers use their own custom warning mechanisms instead default klog warning. * Use typed error instead plain string * Fix interface change in unit test
What type of PR is this?
/kind bug
What this PR does / why we need it:
This provides a way to consumers use their own custom warning mechanisms instead default klog warning.
This PR takes over the previous good attempt #114793 to fix that issue.
Which issue(s) this PR fixes:
Fixes #94428
Special notes for your reviewer:
Does this PR introduce a user-facing change?