1
0
mirror of https://github.com/go-kratos/kratos.git synced 2025-01-16 02:47:03 +02:00
kratos/contrib/log/zap/zap_test.go
杜晨昊 2024fa7cdb
feat: zap log (#1424)
* zap log impl
2021-09-08 13:31:44 +08:00

23 lines
352 B
Go

package zap
import (
"testing"
"go.uber.org/zap"
"github.com/go-kratos/kratos/v2/log"
)
func TestLogger(t *testing.T) {
logger := NewLogger(zap.NewExample())
defer func() { _ = logger.Sync() }()
zlog := log.NewHelper(logger)
zlog.Debugw("log", "debug")
zlog.Infow("log", "info")
zlog.Warnw("log", "warn")
zlog.Errorw("log", "error")
}