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

use klog.InfoS instead of klog.V(0).InfoS #111708

Merged
merged 1 commit into from Sep 19, 2022

Conversation

yangjunmyfm192085
Copy link
Contributor

@yangjunmyfm192085 yangjunmyfm192085 commented Aug 5, 2022

What type of PR is this?

/kind cleanup

What this PR does / why we need it:

use klog.InfoS instead of klog.V(0).InfoS
As mentioned in the issue kubernetes-sigs/logtools#2, Calling V with zero as parameter just causes additional overhead, so we need to avoid this scenario

Which issue(s) this PR fixes:

Fixes #

Special notes for your reviewer:

Does this PR introduce a user-facing change?

release-note

Additional documentation e.g., KEPs (Kubernetes Enhancement Proposals), usage docs, etc.:


/cc @pohly

@k8s-ci-robot k8s-ci-robot requested a review from pohly August 5, 2022 01:51
@k8s-ci-robot k8s-ci-robot added release-note Denotes a PR that will be considered when it comes time to generate release notes. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. do-not-merge/needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. needs-priority Indicates a PR lacks a `priority/foo` label and requires one. labels Aug 5, 2022
@k8s-ci-robot k8s-ci-robot added sig/apps Categorizes an issue or PR as relevant to SIG Apps. sig/network Categorizes an issue or PR as relevant to SIG Network. and removed do-not-merge/needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. labels Aug 5, 2022
@yangjunmyfm192085
Copy link
Contributor Author

/sig instrumentation
/wg structured-logging

@k8s-ci-robot k8s-ci-robot added sig/instrumentation Categorizes an issue or PR as relevant to SIG Instrumentation. wg/structured-logging Categorizes an issue or PR as relevant to WG Structured Logging. labels Aug 5, 2022
Copy link
Contributor Author

@yangjunmyfm192085 yangjunmyfm192085 left a comment

Choose a reason for hiding this comment

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

/test pull-kubernetes-e2e-kind

@pohly
Copy link
Contributor

pohly commented Aug 5, 2022

What this PR does / why we need it:

use klog.InfoS instead of klog.V(0).InfoS

@yangjunmyfm192085 always remember to address the "why" part because that gives a reviewer, often someone who is busy and may lack the necessary background information, an incentive to look at the PR.

In this case it is "... because they are semantically equivalent and V(0) add some (small) overhead".

I prefer to not merge this until we have a way to enforce that this code pattern doesn't get added back in some future PR (kubernetes-sigs/logtools#2).

@dgrisonnet
Copy link
Member

/triage accepted
/assign @pohly

@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 Aug 11, 2022
@k8s-ci-robot k8s-ci-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Aug 25, 2022
@k8s-ci-robot k8s-ci-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Aug 25, 2022
@yangjunmyfm192085
Copy link
Contributor Author

What this PR does / why we need it:
use klog.InfoS instead of klog.V(0).InfoS

@yangjunmyfm192085 always remember to address the "why" part because that gives a reviewer, often someone who is busy and may lack the necessary background information, an incentive to look at the PR.

In this case it is "... because they are semantically equivalent and V(0) add some (small) overhead".

I prefer to not merge this until we have a way to enforce that this code pattern doesn't get added back in some future PR (kubernetes-sigs/logtools#2).

Hi, @pohly, Thanks for the reminder, I added the reason for the modification above.
I agree with you.
But I don't think it conflicts with this pr.
We can modify klog.V(0).InfoS in the repo firstly.
also make sure we have a way to enforce that this code pattern doesn't get added back in some future PR

Copy link
Contributor Author

@yangjunmyfm192085 yangjunmyfm192085 left a comment

Choose a reason for hiding this comment

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

/retest

@pohly
Copy link
Contributor

pohly commented Aug 25, 2022

If we do it in that order, we may have to do the same fixup multiple times because new code adds the pattern back. Let's avoid that.

@pohly
Copy link
Contributor

pohly commented Aug 25, 2022

/hold

@k8s-ci-robot k8s-ci-robot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Aug 25, 2022
@yangjunmyfm192085
Copy link
Contributor Author

I opened a pr kubernetes-sigs/logtools#4 to add checking for logs
Could you take a look @pohly , thanks.

Copy link
Contributor Author

@yangjunmyfm192085 yangjunmyfm192085 left a comment

Choose a reason for hiding this comment

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

Hi, @pohly , Could we consider merge this pr now?
Of course, I will continue to analyze other errors in logcheck.

@pohly
Copy link
Contributor

pohly commented Sep 13, 2022

Yes, let's merge this now. Releasing a new logcheck is taking a bit longer, so enabling the check will have to wait.

/hold cancel
/lgtm

@k8s-ci-robot k8s-ci-robot added lgtm "Looks good to me", indicates that a PR is ready to be merged. and removed do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. labels Sep 13, 2022
@pohly
Copy link
Contributor

pohly commented Sep 13, 2022

/assign @smarterclayton

For approval.

@yangjunmyfm192085
Copy link
Contributor Author

/cc @liggitt

@liggitt
Copy link
Member

liggitt commented Sep 19, 2022

/approve

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: liggitt, yangjunmyfm192085

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

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. kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. lgtm "Looks good to me", indicates that a PR is ready to be merged. needs-priority Indicates a PR lacks a `priority/foo` label and requires one. release-note Denotes a PR that will be considered when it comes time to generate release notes. sig/apps Categorizes an issue or PR as relevant to SIG Apps. sig/instrumentation Categorizes an issue or PR as relevant to SIG Instrumentation. sig/network Categorizes an issue or PR as relevant to SIG Network. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. triage/accepted Indicates an issue or PR is ready to be actively worked on. wg/structured-logging Categorizes an issue or PR as relevant to WG Structured Logging.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants