Skip to content
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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

馃悰 Fix log depth for DelegatingLogSink #1975

Merged
merged 1 commit into from Aug 12, 2022

Conversation

alculquicondor
Copy link
Contributor

Fixes #1737

Adds a depth of 1 to the DelegatingLogSink sink, instead of a global depth to the zapr sink.

This global depth is problematic because it doesn't apply to loggers obtained with WithName or WithValues.

Notes for reviewer

To see this fix in action (and the bug before this fix), go to examples/scratch-env/main.go and set Development mode to false.

@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Aug 10, 2022
@alculquicondor
Copy link
Contributor Author

It looks like the linter is broken

@alculquicondor
Copy link
Contributor Author

/assign @alvaroaleman

@alvaroaleman
Copy link
Member

looks like golangci-lint is too old

@alvaroaleman
Copy link
Member

I think it should pass after #1976

@alvaroaleman
Copy link
Member

@alculquicondor can you rebase? It doesn't look like github actions merges into the base prior to reading the job config, I re-ran the action and it still uses the old golang-ci lint version: https://github.com/kubernetes-sigs/controller-runtime/runs/7795811041?check_suite_focus=true#step:3:16

Copy link
Member

@alvaroaleman alvaroaleman left a comment

Choose a reason for hiding this comment

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

thanks!

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Aug 12, 2022
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: alculquicondor, alvaroaleman

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 /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Aug 12, 2022
@k8s-ci-robot k8s-ci-robot merged commit 5a88c51 into kubernetes-sigs:master Aug 12, 2022
@k8s-ci-robot k8s-ci-robot added this to the v0.10.x milestone Aug 12, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. size/S Denotes a PR that changes 10-29 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

DelegatingLogger reports incorrect source lines when zap.AddCaller() option is used
3 participants