Skip to content
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

Change Logger.Log specification to "should not actually panic or exit" #168

Merged
merged 5 commits into from
Nov 10, 2016

Conversation

jcorbin
Copy link
Contributor

@jcorbin jcorbin commented Nov 7, 2016

Towards #166

@jcorbin jcorbin mentioned this pull request Nov 7, 2016
3 tasks
jcorbin pushed a commit that referenced this pull request Nov 7, 2016
@jcorbin
Copy link
Contributor Author

jcorbin commented Nov 7, 2016

Updated #161 to use this, to resolve its prior note on Fatal and Panic

jcorbin pushed a commit that referenced this pull request Nov 9, 2016
@jcorbin jcorbin mentioned this pull request Nov 9, 2016
4 tasks
jcorbin pushed a commit that referenced this pull request Nov 9, 2016
Copy link
Contributor

@akshayjshah akshayjshah left a comment

Choose a reason for hiding this comment

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

Would appreciate the small wording changes noted, but otherwise looks great.

@@ -50,6 +50,11 @@ type Logger interface {

// Log a message at the given level. Messages include any context that's
// accumulated on the logger, as well as any fields added at the log site.
//
// Calling Panic should panic(), calling Fatal() should terminate the
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: "...should panic() and calling Fatal()..."

assert.Panics(t, func() { logger.Log(PanicLevel, "foo") }, "Expected logging at Panic level to panic.")
assert.Equal(t, `{"level":"panic","msg":"foo"}`, buf.Stripped(), "Unexpected output from panic-level Log.")
})
func TestJSONLoggerLog_panic(t *testing.T) {
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't think that we're using this underscore convention in the rest of the test suite; purely for consistency, can we call these TestJSONLoggerLogPanic and ...Fatal?

Copy link
Contributor

Choose a reason for hiding this comment

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

Whoops, I lied - we're using this in the bark wrapper code. Mea culpa, do as you wish.

jcorbin pushed a commit that referenced this pull request Nov 9, 2016
@akshayjshah
Copy link
Contributor

lgtm, merge away.

@jcorbin jcorbin merged commit 9c9a580 into master Nov 10, 2016
@jcorbin jcorbin deleted the log_fatal_panic branch November 10, 2016 00:08
jcorbin pushed a commit that referenced this pull request Nov 10, 2016
jcorbin pushed a commit that referenced this pull request Nov 14, 2016
jcorbin pushed a commit that referenced this pull request Nov 14, 2016
jcorbin pushed a commit that referenced this pull request Nov 15, 2016
jcorbin pushed a commit that referenced this pull request Nov 17, 2016
jcorbin pushed a commit that referenced this pull request Nov 20, 2016
jcorbin pushed a commit that referenced this pull request Nov 22, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants