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
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. 👍