fix: honor klog -stderrthreshold even when -logtostderr is true#695
Conversation
|
Hi, the |
|
Hi — gentle reminder. The |
|
Hi — friendly follow-up. Could a collaborator run |
|
Hi — gentle ping on this PR. The |
c4a760f to
4565edc
Compare
|
Hi — just a quick ping on the CI status. The Could a maintainer run |
4565edc to
45c10f8
Compare
klog v2 defaults -logtostderr to true, which silently ignores -stderrthreshold — all log levels go to stderr unconditionally. This has been an open issue since 2020 (kubernetes/klog#212). klog v2.140.0 introduced a fix behind an opt-in flag (legacy_stderr_threshold_behavior). This commit bumps klog to v2.140.0 and enables the fix so that -stderrthreshold is honored, while preserving the current default behavior (stderrthreshold=INFO means all logs still go to stderr unless the user overrides it on the command line). Ref: kubernetes/klog#212 Ref: kubernetes/klog#432 Signed-off-by: Pierluigi Lenoci <pierluigilenoci@gmail.com>
45c10f8 to
36a87f6
Compare
|
/gcbrun |
What changed
klog v2 defaults
-logtostderrtotrue, which silently ignores-stderrthreshold— all log levels go to stderr unconditionally. This has been an open issue since 2020.klog v2.140.0 introduced a fix behind an opt-in flag (
legacy_stderr_threshold_behavior). This PR bumps klog to v2.140.0 and enables the fix inflags/flags.goso that-stderrthresholdis honored, while preserving the current default behavior (stderrthreshold=INFOmeans all logs still go to stderr unless the user explicitly overrides it on the command line).What the fix does
Since the
Import()function applies caller-provided defaults afterInitFlags, any project-level overrides viadefmapcontinue to work as before.References