forked from golang/glog
-
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
klog.Fatal backtrace revert #328
Merged
Merged
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
question: klog already writes the stack trace of current go routine to the stderr https://github.com/kubernetes/klog/pull/328/files#diff-d11e021bcd662e6127823cd93eeac7a9aec303039137c2f27974cff399142e84R875 here along with some other information. Wont this cause a duplication in the stderr output.?
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.
I was relying on the tests under
integration_tests
to represent the intended behavior. But you are right, now is a good time to verify that those tests and the corresponding behavior are really what we want.-logtostderr
is the default. No backtrace:It gets printed when writing to files (
-logtostderr=false
) and then also appears on stderr (because-alsologtostderr
only applies to severity below the error threshold):Note that internal.FATAL contains all goroutines and stderr only the current one.
That no backtrace is printed for -logtostderr is debatable, but it is what klog traditionally did. I verified that by checking out dc5546c (the commit where these tests were initially added). I don't know why the behavior is what it is (or rather, was) - it could be a bug or intentional because the original authors thought that logging to only stderr should produce brief output.
In this PR, I just want to revert to the original behavior and not add my own interpretation of what the behavior should be.
We could do that in another PR, but personally I think that we shouldn't do that - that already had undesirable consequences once when it was tried in PR #79.
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.
Thanks for explaining this. 👍