Skip to content

stderrthreshold is useless if logtostderr is set#31

Merged
k8s-ci-robot merged 1 commit intokubernetes:masterfrom
shsjshentao:master
Dec 24, 2018
Merged

stderrthreshold is useless if logtostderr is set#31
k8s-ci-robot merged 1 commit intokubernetes:masterfrom
shsjshentao:master

Conversation

@shsjshentao
Copy link
Copy Markdown

@shsjshentao shsjshentao commented Dec 7, 2018

stderrthreshold is useless if logtostderr is set.
This pr can ignore logs which log level is under stderrthreshold.
Like:
flag.Set("logtostderr","true")
flag.Set("stderrthreshold","ERROR")

Does this PR introduce a user-facing change?:

The flag "stderrthreshold" will take effect if flag "logtostderr" is set to "true".
In previous version, it will print all level logs whatever "stderrthreshold" is set.

@k8s-ci-robot k8s-ci-robot requested review from dims and thockin December 7, 2018 06:45
@k8s-ci-robot k8s-ci-robot added the size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. label Dec 7, 2018
@shsjshentao
Copy link
Copy Markdown
Author

I signed it

@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Dec 7, 2018
@dims
Copy link
Copy Markdown
Member

dims commented Dec 7, 2018

/approve

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Dec 7, 2018
Comment thread klog.go
}
} else {
if alsoToStderr || l.alsoToStderr || s >= l.stderrThreshold.get() {
os.Stderr.Write(data)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I think we should make alsologtostderr behave the same way?

@justinsb
Copy link
Copy Markdown
Member

I agree with this change, but this is a behavioural change. I don't know if it will catch anyone out, as the new behaviour feels more correct. We should ensure this makes the release notes though!

@DirectXMan12
Copy link
Copy Markdown

I agree as well. I think the previous behavior was more confusing, and I've talked to plenty of people that assume it works this way before trying it (I assumed this as well at some point).

@dims
Copy link
Copy Markdown
Member

dims commented Dec 21, 2018

@shsjshentao can you please update the Does this PR introduce a user-facing change?: section above?

/approve

@dims
Copy link
Copy Markdown
Member

dims commented Dec 24, 2018

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Dec 24, 2018
@k8s-ci-robot
Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: dims, shsjshentao

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details 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

@dims
Copy link
Copy Markdown
Member

dims commented Dec 24, 2018

thanks @shsjshentao

@k8s-ci-robot k8s-ci-robot merged commit f0c3f94 into kubernetes:master Dec 24, 2018
mtaufen added a commit to mtaufen/klog that referenced this pull request Mar 4, 2019
This reverts commit f0c3f94, reversing
changes made to 73cec49.
@mtaufen mtaufen mentioned this pull request Mar 4, 2019
mtaufen added a commit to mtaufen/klog that referenced this pull request Mar 6, 2019
This reverts commit f0c3f94, reversing
changes made to 73cec49.
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/XS Denotes a PR that changes 0-9 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants