diff --git a/logger/logger_test.go b/logger/logger_test.go index 1fcf2050..1fe1341c 100644 --- a/logger/logger_test.go +++ b/logger/logger_test.go @@ -120,21 +120,20 @@ func TestLogger(t *testing.T) { t.Fatal(err) } l.Trace(ctx, "trace_msg1") - // l.Warn(ctx, "warn_msg1") - // l.Fields("error", "test").Info(ctx, "error message") - // l.Warn(ctx, "first second") + l.Warn(ctx, "warn_msg1") + l.Fields("error", "test").Info(ctx, "error message") + l.Warn(ctx, "first second") if !bytes.Contains(buf.Bytes(), []byte(`"level":"trace","msg":"trace_msg1"`)) { t.Fatalf("logger tracer, buf %s", buf.Bytes()) } - /* - if !bytes.Contains(buf.Bytes(), []byte(`"warn","msg":"warn_msg1"`)) { - t.Fatalf("logger warn, buf %s", buf.Bytes()) - } - if !bytes.Contains(buf.Bytes(), []byte(`"error":"test","level":"info","msg":"error message"`)) { - t.Fatalf("logger info, buf %s", buf.Bytes()) - } - if !bytes.Contains(buf.Bytes(), []byte(`"level":"warn","msg":"first second"`)) { - t.Fatalf("logger warn, buf %s", buf.Bytes()) - } - */ + + if !bytes.Contains(buf.Bytes(), []byte(`"level":"warn","msg":"warn_msg1"`)) { + t.Fatalf("logger warn, buf %s", buf.Bytes()) + } + if !bytes.Contains(buf.Bytes(), []byte(`"level":"info","msg":"error message","error":"test"`)) { + t.Fatalf("logger info, buf %s", buf.Bytes()) + } + if !bytes.Contains(buf.Bytes(), []byte(`"level":"warn","msg":"first second"`)) { + t.Fatalf("logger warn, buf %s", buf.Bytes()) + } }