You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
kratos/contrib/log/zap/zap_test.go

23 lines
352 B

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")
}