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.
23 lines
352 B
23 lines
352 B
3 years ago
|
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")
|
||
|
}
|