mirror of
https://gitee.com/milvus-io/milvus.git
synced 2025-12-07 01:28:27 +08:00
Related to #39095 https://go.dev/doc/modules/version-numbers Update pkg version according to golang dep version convention --------- Signed-off-by: Congqi Xia <congqi.xia@zilliz.com>
31 lines
734 B
Go
31 lines
734 B
Go
package logutil
|
|
|
|
import (
|
|
"testing"
|
|
|
|
"github.com/stretchr/testify/assert"
|
|
"go.uber.org/zap"
|
|
"go.uber.org/zap/zapcore"
|
|
|
|
"github.com/milvus-io/milvus/pkg/v2/log"
|
|
)
|
|
|
|
func TestName(t *testing.T) {
|
|
conf := &log.Config{Level: "debug", DisableTimestamp: true}
|
|
logger, _, _ := log.InitTestLogger(t, conf, zap.AddCallerSkip(1), zap.Hooks(func(entry zapcore.Entry) error {
|
|
assert.Equal(t, "Testing", entry.Message)
|
|
return nil
|
|
}))
|
|
wrapper := &zapWrapper{logger, 0}
|
|
|
|
wrapper.Info("Testing")
|
|
wrapper.Infoln("Testing")
|
|
wrapper.Infof("%s", "Testing")
|
|
wrapper.Warning("Testing")
|
|
wrapper.Warningln("Testing")
|
|
wrapper.Warningf("%s", "Testing")
|
|
wrapper.Error("Testing")
|
|
wrapper.Errorln("Testing")
|
|
wrapper.Errorf("%s", "Testing")
|
|
}
|