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:
|
case InfoLevel:
|
||||||
return "info"
|
return "info"
|
||||||
case WarnLevel:
|
case WarnLevel:
|
||||||
return "warning"
|
return "warn"
|
||||||
case ErrorLevel:
|
case ErrorLevel:
|
||||||
return "error"
|
return "error"
|
||||||
case FatalLevel:
|
case FatalLevel:
|
||||||
|
|
|
@ -78,7 +78,7 @@ func ExampleLogger_Warn() {
|
||||||
Str("foo", "bar").
|
Str("foo", "bar").
|
||||||
Msg("a warning message")
|
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() {
|
func ExampleLogger_Error() {
|
||||||
|
|
|
@ -243,7 +243,7 @@ func TestLevelWriter(t *testing.T) {
|
||||||
}{
|
}{
|
||||||
{DebugLevel, `{"level":"debug","message":"1"}` + "\n"},
|
{DebugLevel, `{"level":"debug","message":"1"}` + "\n"},
|
||||||
{InfoLevel, `{"level":"info","message":"2"}` + "\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"},
|
{ErrorLevel, `{"level":"error","message":"4"}` + "\n"},
|
||||||
}
|
}
|
||||||
if got := lw.ops; !reflect.DeepEqual(got, want) {
|
if got := lw.ops; !reflect.DeepEqual(got, want) {
|
||||||
|
|
|
@ -49,7 +49,7 @@ func TestSyslogWriter(t *testing.T) {
|
||||||
want := []syslogEvent{
|
want := []syslogEvent{
|
||||||
{"Debug", `{"level":"debug","message":"debug"}` + "\n"},
|
{"Debug", `{"level":"debug","message":"debug"}` + "\n"},
|
||||||
{"Info", `{"level":"info","message":"info"}` + "\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"},
|
{"Err", `{"level":"error","message":"error"}` + "\n"},
|
||||||
}
|
}
|
||||||
if got := sw.events; !reflect.DeepEqual(got, want) {
|
if got := sw.events; !reflect.DeepEqual(got, want) {
|
||||||
|
|
|
@ -15,7 +15,7 @@ func TestMultiSyslogWriter(t *testing.T) {
|
||||||
want := []syslogEvent{
|
want := []syslogEvent{
|
||||||
{"Debug", `{"level":"debug","message":"debug"}` + "\n"},
|
{"Debug", `{"level":"debug","message":"debug"}` + "\n"},
|
||||||
{"Info", `{"level":"info","message":"info"}` + "\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"},
|
{"Err", `{"level":"error","message":"error"}` + "\n"},
|
||||||
}
|
}
|
||||||
if got := sw.events; !reflect.DeepEqual(got, want) {
|
if got := sw.events; !reflect.DeepEqual(got, want) {
|
||||||
|
|
Loading…
Reference in New Issue