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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

automatically detect and lint wrappers around log calls #21

Open
pohly opened this issue Jun 29, 2023 · 6 comments
Open

automatically detect and lint wrappers around log calls #21

pohly opened this issue Jun 29, 2023 · 6 comments
Labels
triage/accepted Indicates an issue or PR is ready to be actively worked on.

Comments

@pohly
Copy link
Contributor

pohly commented Jun 29, 2023

When a wrapper functions accepts variadic arguments and passes them through to a log call, then the same rules as for that log call also apply to the wrapper.

logcheck previously side-stepped that issue by not allowing passing of unknown slices to log calls. #20 relaxed that.

@k8s-ci-robot k8s-ci-robot added the needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. label Jun 29, 2023
@pohly
Copy link
Contributor Author

pohly commented Jun 29, 2023

As discussed in #20 (comment), something similar to printf-format checking should also be possible for log calls.

/triage accepted
/assign @jaythamke

@k8s-ci-robot
Copy link
Contributor

@pohly: GitHub didn't allow me to assign the following users: jaythamke.

Note that only kubernetes-sigs members with read permissions, repo collaborators and people who have commented on this issue/PR can be assigned. Additionally, issues/PRs can only have 10 assignees at the same time.
For more information please see the contributor guide

In response to this:

As discussed in #20 (comment), something similar to printf-format checking should also be possible for log calls.

/triage accepted
/assign @jaythamke

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.

@k8s-ci-robot k8s-ci-robot added triage/accepted Indicates an issue or PR is ready to be actively worked on. and removed needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. labels Jun 29, 2023
@k8s-triage-robot
Copy link

This issue has not been updated in over 1 year, and should be re-triaged.

You can:

  • Confirm that this issue is still relevant with /triage accepted (org members only)
  • Close this issue with /close

For more details on the triage process, see https://www.kubernetes.dev/docs/guide/issue-triage/

/remove-triage accepted

@k8s-ci-robot k8s-ci-robot added needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. and removed triage/accepted Indicates an issue or PR is ready to be actively worked on. labels Jun 28, 2024
@pohly
Copy link
Contributor Author

pohly commented Jun 28, 2024

/triage accepted

@k8s-ci-robot k8s-ci-robot added triage/accepted Indicates an issue or PR is ready to be actively worked on. and removed needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. labels Jun 28, 2024
@pohly
Copy link
Contributor Author

pohly commented Jun 29, 2024

@jaythamke: are you still interested in working on this?

I was reminded again of this when re-activating kubernetes/kubernetes#121989. The new(ish) HandleErrorWithContext accepts key/value pairs:

utilruntime.HandleErrorWithContext(ctx, err, "Sync failed", "key", cKey)

It would be nice to get linting for that.

@pohly
Copy link
Contributor Author

pohly commented Jun 29, 2024

Related: go-simpler/sloglint#22

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
triage/accepted Indicates an issue or PR is ready to be actively worked on.
Projects
None yet
Development

No branches or pull requests

3 participants