Skip to content

divide log output between stdout and stderr #676

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Merged
merged 1 commit into from
Aug 18, 2022
Merged

Conversation

cjerad
Copy link
Member

@cjerad cjerad commented Aug 17, 2022

Issue #, if available:

#667 Node Termination Handler only logs to stderr

Description of changes:

Route messages of warning or higher to stderr, everything else to stdout.

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@cjerad cjerad marked this pull request as ready for review August 18, 2022 14:58
@cjerad cjerad requested a review from a team as a code owner August 18, 2022 14:58
l := log.Output(logging.RoutingLevelWriter{Writer: buf, ErrWriter: errBuf})

const s = "this is a test"
l.Info().Msg(s)
Copy link
Contributor

Choose a reason for hiding this comment

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

I like that you wrote an "integration" test suite as well, to demonstrate how logging actually occurs in this project. Nice work!

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants