[v3] remove using global map for default codecs (#224)
Some checks failed
test / test (push) Failing after 15m22s
coverage / build (push) Failing after 15m33s

* remove using global map for default codecs

* fix tests
This commit is contained in:
2025-10-15 23:33:32 +05:00
committed by GitHub
parent a68d3b24b8
commit 3e86864ce7
5 changed files with 6 additions and 21 deletions

View File

@@ -62,7 +62,7 @@ func TestTime(t *testing.T) {
WithHandlerFunc(slog.NewTextHandler),
logger.WithAddStacktrace(true),
logger.WithTimeFunc(func() time.Time {
return time.Unix(0, 0)
return time.Unix(0, 0).UTC()
}),
)
if err := l.Init(logger.WithFields("key1", "val1")); err != nil {
@@ -71,8 +71,7 @@ func TestTime(t *testing.T) {
l.Error(ctx, "msg1", errors.New("err"))
if !bytes.Contains(buf.Bytes(), []byte(`timestamp=1970-01-01T03:00:00.000000000+03:00`)) &&
!bytes.Contains(buf.Bytes(), []byte(`timestamp=1970-01-01T00:00:00.000000000Z`)) {
if !bytes.Contains(buf.Bytes(), []byte(`timestamp=1970-01-01T00:00:00.000000000Z`)) {
t.Fatalf("logger error not works, buf contains: %s", buf.Bytes())
}
}