Rename warning field to warn in the output
This commit is contained in:
parent
9889521807
commit
2a829377cb
2
log.go
2
log.go
|
@ -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:
|
||||
|
|
|
@ -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() {
|
||||
|
|
|
@ -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) {
|
||||
|
|
|
@ -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) {
|
||||
|
|
|
@ -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) {
|
||||
|
|
Loading…
Reference in New Issue