-
Notifications
You must be signed in to change notification settings - Fork 1.2k
⚠️ kube aware logger which could also work with logger.WithValues #1883
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
base: main
Are you sure you want to change the base?
Conversation
Welcome @STRRL! |
Hi @STRRL. 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. |
Hi! I think this PR is ready for view. /cc @timebertt |
@STRRL: GitHub didn't allow me to request PR reviews from the following users: timebertt. Note that only kubernetes-sigs members and repo collaborators can review this PR, and authors cannot review their own PRs. In response to this:
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. |
PTAL /cc @FillZpp |
examples/configfile/builtin/main.go
Outdated
"sigs.k8s.io/controller-runtime/pkg/manager/signals" | ||
) | ||
|
||
var scheme = runtime.NewScheme() | ||
|
||
func init() { | ||
log.SetLogger(zap.New()) | ||
log.SetLogger(bootstrap.New()) |
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.
It is a breaking change for those who are importing controller runtime.
Can you please use the emoji :warning:
?
Also, do we need to change the lib?
pkg/log/zap/zap.go
Outdated
@@ -39,6 +39,7 @@ type NewEncoderFunc func(...EncoderConfigOption) zapcore.Encoder | |||
// New returns a brand new Logger configured with Opts. It | |||
// uses KubeAwareEncoder which adds Type information and | |||
// Namespace/Name to the log. | |||
// Deprecated: use bootstrap.New as instead. |
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 reason for moving things around? If anyhow possible, lets avoid this. All existing projects will need to be updated to get this fix, that is something we absolutely want to avoid.
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 reason for moving things around?
I think using zap
as the package name might bring confusion to users because we actually do not use zap.Logger
but logr.Logger
.
As the controller-runtime still stay with 0.x.x
, I think maybe it would be friendly to introduce breaking changes right now rather than bring breaking changes after the stable 1.x.x
. ❤️
If anyhow possible, lets avoid this.
I would make it a try! :D
/ok-to-test |
2268f75
to
42e1664
Compare
da24bda
to
521d348
Compare
The Kubernetes project currently lacks enough contributors to adequately respond to all PRs. This bot triages PRs according to the following rules:
You can:
Please send feedback to sig-contributor-experience at kubernetes/community. /lifecycle stale |
The Kubernetes project currently lacks enough active contributors to adequately respond to all PRs. This bot triages PRs according to the following rules:
You can:
Please send feedback to sig-contributor-experience at kubernetes/community. /lifecycle rotten |
The Kubernetes project currently lacks enough active contributors to adequately respond to all issues and PRs. This bot triages PRs according to the following rules:
You can:
Please send feedback to sig-contributor-experience at kubernetes/community. /close |
@k8s-triage-robot: Closed this PR. In response to this:
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. |
/reopen |
@STRRL: Reopened this PR. In response to this:
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-sigs/prow repository. |
Signed-off-by: STRRL <im@strrl.dev>
The Kubernetes project currently lacks enough active contributors to adequately respond to all issues and PRs. This bot triages PRs according to the following rules:
You can:
Please send feedback to sig-contributor-experience at kubernetes/community. /close |
@k8s-triage-robot: Closed this PR. In response to this:
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-sigs/prow repository. |
:( |
! |
/reopen (I don't have bandwidth to review atm though) |
@sbueringer: Reopened this PR. In response to this:
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-sigs/prow repository. |
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: STRRL The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
PR needs rebase. 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-sigs/prow repository. |
@STRRL: The following tests failed, say
Full PR test history. Your PR dashboard. Please help us cut down on flakes by linking to an open issue when you hit one in your PR. 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-sigs/prow repository. I understand the commands that are listed here. |
Signed-off-by: STRRL im@strrl.dev
This PR could fix #1290
As this comment says, the latest logr provide
logr.Marshaler
, it could be used instead the current "kube-aware-logger-things" implementation with custom zap encoder