-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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 helpers to configure logger options via pflags #767
✨ Add helpers to configure logger options via pflags #767
Conversation
Welcome @bharathi-tenneti! |
Hi @bharathi-tenneti. Thanks for your PR. I'm waiting for a kubernetes-sigs member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
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.
Some suggestions for cleaning up the var names a bit.
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.
Somewhere in here, we probably need to make sure that sampling is turned off when we're logging at a debug level (if we aren't already), because it will cause a panic.
/ok-to-test |
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.
Some suggestions and nits.
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
pkg/log/zap/zap.go
Outdated
@@ -207,3 +208,44 @@ func NewRaw(opts ...Opts) *zap.Logger { | |||
log = log.WithOptions(o.ZapOpts...) | |||
return log | |||
} | |||
|
|||
// BindToFlagSet func allows CLI passed flags to be parsed. |
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.
// BindToFlagSet func allows CLI passed flags to be parsed. | |
// BindFlagSet will parse the given flagset for zap option flags and set the log options accordingly |
Also for the godoc comment here, can you add the list of flag names that BindFlags currently parses.
Co-Authored-By: Haseeb Tariq <hasbro17@gmail.com>
/approve |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: bharathi-tenneti, shawn-hurley 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 |
/lgtm |
@gerred This got merged with the commits unsquashed. @DirectXMan12 I don't think we can clean this up now but is there any way to avoid this in the future? e.g have the bot squash them for us or a linter to make sure we clean up before merging. |
@hasbro17 Yeah, this ended up being a little lax. @shawn-hurley maybe we reverse the relationship in the future as well. As an approver I'm typically looking for those squashed commits when I approve, but I didn't take the due diligence to look back and see that it had already been approved before I /lgtmed. I'll do so in the future, but we should work together to make sure the reviewer is looking at the changes in and of itself and the approver is doing the same work, but also making sure it meets the criteria for being merged. I think it'd nbd but we can always stand to improve project hygiene! |
oh yeah. We should add a CI check or something for this |
PR kubernetes-sigs#767 introduces some weird merge commit styles into the git history by default, so now we have to tolerate them in our release notes script.
This PR allows logging flags(/pkg/log/zap), to be passed from command line in addition to functional calls.
Follow up from #639