Skip to content

Commit

Permalink
Rename warning field to warn in the output
Browse files Browse the repository at this point in the history
  • Loading branch information
rs committed Jun 8, 2017
1 parent 9889521 commit 2a82937
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion log.go
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ func (l Level) String() string {
case InfoLevel:
return "info"
case WarnLevel:
return "warning"
return "warn"
case ErrorLevel:
return "error"
case FatalLevel:
Expand Down
2 changes: 1 addition & 1 deletion log_example_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ func ExampleLogger_Warn() {
Str("foo", "bar").
Msg("a warning message")

// Output: {"level":"warning","foo":"bar","message":"a warning message"}
// Output: {"level":"warn","foo":"bar","message":"a warning message"}
}

func ExampleLogger_Error() {
Expand Down
2 changes: 1 addition & 1 deletion log_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@ func TestLevelWriter(t *testing.T) {
}{
{DebugLevel, `{"level":"debug","message":"1"}` + "\n"},
{InfoLevel, `{"level":"info","message":"2"}` + "\n"},
{WarnLevel, `{"level":"warning","message":"3"}` + "\n"},
{WarnLevel, `{"level":"warn","message":"3"}` + "\n"},
{ErrorLevel, `{"level":"error","message":"4"}` + "\n"},
}
if got := lw.ops; !reflect.DeepEqual(got, want) {
Expand Down
2 changes: 1 addition & 1 deletion syslog_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ func TestSyslogWriter(t *testing.T) {
want := []syslogEvent{
{"Debug", `{"level":"debug","message":"debug"}` + "\n"},
{"Info", `{"level":"info","message":"info"}` + "\n"},
{"Warning", `{"level":"warning","message":"warn"}` + "\n"},
{"Warning", `{"level":"warn","message":"warn"}` + "\n"},
{"Err", `{"level":"error","message":"error"}` + "\n"},
}
if got := sw.events; !reflect.DeepEqual(got, want) {
Expand Down
2 changes: 1 addition & 1 deletion writer_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ func TestMultiSyslogWriter(t *testing.T) {
want := []syslogEvent{
{"Debug", `{"level":"debug","message":"debug"}` + "\n"},
{"Info", `{"level":"info","message":"info"}` + "\n"},
{"Warning", `{"level":"warning","message":"warn"}` + "\n"},
{"Warning", `{"level":"warn","message":"warn"}` + "\n"},
{"Err", `{"level":"error","message":"error"}` + "\n"},
}
if got := sw.events; !reflect.DeepEqual(got, want) {
Expand Down

0 comments on commit 2a82937

Please sign in to comment.