-
Notifications
You must be signed in to change notification settings - Fork 43
Conversation
/assign @chuckha This is a beginning sketch of how we can handle logging for the actuators. Please review and share your thoughts about the general direction. |
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.
few comments
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.
will need a few updates, but nice job removing the fmt
import. that's dope.
030ff22
to
2592843
Compare
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.
All of the error logs need to include the stack trace.
I think there's probably a better way to do this, maybe a function like:
func (c *Cluster) handleError(err error) error {
// log stacktrace
// return err
}
/test pull-cluster-api-provider-docker-verify |
/retest |
@amy: Cannot trigger testing until a trusted user reviews the PR and leaves an 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. |
/ok-to-test |
/retest |
It looks like we're losing the stack traces, is that right? I don't want to give those up, they have been very useful during development |
Re: stacktrace comments. I think that was a misunderstanding we cleared up? |
@chuckha, @amy what's the status of https://github.com/kubernetes/klog? should we be using that here like k/k? |
I'm in favor of a simplified logging interface, be it go-logr or something similar. But I would probably prefer something other than klog. Maybe zapr, since that's what kubebuilder seems to integrate by default now? |
this pr is focused on plugging logr.Logger through and using a minor shim to keep stack traces around. we can swap out the klogr implementation for zapr or whatever we want later, no matter which one we pick we will be pulling in a dependency so i am not fussed either way. From what i understand kubebuilder has done a lot of work to make the log implementation pluggable so we don't need to pick zapr because they do. |
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, just missing the license on one file
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.
/approve
thank you!
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: amy, chuckha 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 |
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
not a big fan of logr, but +1 on having a logger shim as early as possible!
This PR partially addresses: #22
Specifically this adds loggers to the actuators.
The pattern used here was inspired by the aws provider. Ex: https://github.com/kubernetes-sigs/cluster-api-provider-aws/blob/master/pkg/cloud/aws/actuators/cluster/actuator.go#L41