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
Add LogToOutput, a one-stop shop for writing logs to a io.Writer #99
Conversation
Welcome @liztio! |
/assign @DirectXMan12 |
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: liztio 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 |
I do not understand where the failing /v2 tests are coming from, I don't see any directory containing them? |
it's the name/version of the module AFAIK: |
/assign @liggitt Jordan, there was an earlier PR that was similar in terms of "make stuff easy" and you had chimed in there. WDYT? |
logging.mu.Lock() | ||
defer logging.mu.Unlock() | ||
|
||
logging.toStderr = false |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we wanted to give programmatic access to toStderr
, that seems more reasonable. A single method that does that and combines it with a wrapped call to an existing method (SetOutput
) seems fairly inflexible.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's reasonable, I can knock out a PR like that real quick
Issues go stale after 90d of inactivity. If this issue is safe to close now please do so with Send feedback to sig-testing, kubernetes/test-infra and/or fejta. |
Stale issues rot after 30d of inactivity. If this issue is safe to close now please do so with Send feedback to sig-testing, kubernetes/test-infra and/or fejta. |
Rotten issues close after 30d of inactivity. Send feedback to sig-testing, kubernetes/test-infra and/or fejta. |
@fejta-bot: Closed this PR. In response to this:
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. |
What this PR does / why we need it:
Right now, SetOutput() is mostly useless without also manually setting a flag, as per #87. The way this flag setting interacts with actual flags, flag.Parse() etc is confusing and feels hacky. This change adds a single method, LogToOutput, which both sets an output and disables logging exclusively to stderr.
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 #87 (maybe?)
Special notes for your reviewer:
I'm not committed to this method name
Please confirm that if this PR changes any image versions, then that's the sole change this PR makes.
Release note: