Fix trace again

This commit is contained in:
Olivier Poitrey 2019-11-18 16:31:13 -08:00
parent 686705b4f0
commit f1dd50b8c6
2 changed files with 4 additions and 4 deletions

View File

@ -36,7 +36,6 @@ func (sw syslogWriter) Write(p []byte) (n int, err error) {
func (sw syslogWriter) WriteLevel(level Level, p []byte) (n int, err error) { func (sw syslogWriter) WriteLevel(level Level, p []byte) (n int, err error) {
switch level { switch level {
case TraceLevel: case TraceLevel:
err = sw.w.Trace(string(p))
case DebugLevel: case DebugLevel:
err = sw.w.Debug(string(p)) err = sw.w.Debug(string(p))
case InfoLevel: case InfoLevel:

View File

@ -3,8 +3,10 @@
package zerolog package zerolog
import "testing" import (
import "reflect" "reflect"
"testing"
)
type syslogEvent struct { type syslogEvent struct {
level string level string
@ -56,7 +58,6 @@ func TestSyslogWriter(t *testing.T) {
log.Error().Msg("error") log.Error().Msg("error")
log.Log().Msg("nolevel") log.Log().Msg("nolevel")
want := []syslogEvent{ want := []syslogEvent{
{"Trace", `{"level":"trace","message":"trace"}` + "\n"},
{"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":"warn","message":"warn"}` + "\n"}, {"Warning", `{"level":"warn","message":"warn"}` + "\n"},