mirror of
https://github.com/go-kratos/kratos.git
synced 2025-01-16 02:47:03 +02:00
2024fa7cdb
* zap log impl
23 lines
352 B
Go
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")
|
|
}
|