-
Notifications
You must be signed in to change notification settings - Fork 214
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
Programmatically set oneOutput flag #373
Programmatically set oneOutput flag #373
Conversation
This enhancement enables an application to programatically set the oneOutput flag without needing to expose flags on the command line. It aligns with the existing functions LogToStderr and SetOutputBySeverity, such that one can direct messages to different output destinations and control whether those messages are only written to their native severity level.
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: danmillwood The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
This issue is currently awaiting triage. If klog contributors determine this is a relevant issue, they will accept it by applying the The 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. |
Welcome @danmillwood! |
A program doesn't need to do that. See #336 That's the solution that I prefer, not adding more individual API calls. |
Thanks for the pointer. I hadn't appreciated there was an alternative. |
This enhancement enables an application to programatically set the
logging.oneOutput
flag without needing to expose the klog flags on the command line. It aligns with the existing functionsLogToStderr(..)
andSetOutputBySeverity(..)
, such that one can direct messages to different output destinations and control whether those messages are only written to their native severity level.What this PR does / why we need it:
The enhancement introduces a new function
SetOneOutput(bool)
that updates the value of thelogging.oneOutput
flag.Which issue(s) this PR fixes (optional, in
fixes #<issue number>(, fixes #<issue_number>, ...)
format, will close the issue(s) when PR gets merged):Fixes #
Release note: