used logger custom interface instead of grpclog.LoggerV2

This commit is contained in:
Evgeniy Kulikov 2020-03-03 13:36:20 +03:00
parent 50e74ee3a1
commit 2db83caf29
No known key found for this signature in database
GPG key ID: BF6AEE0A2A699BF2

View file

@ -10,10 +10,17 @@ import (
"go.uber.org/zap/zapcore"
)
type zapLogger struct {
zapcore.Core
log *zap.SugaredLogger
}
type (
zapLogger struct {
zapcore.Core
log *zap.SugaredLogger
}
logger interface {
grpclog.LoggerV2
Println(v ...interface{})
}
)
const (
formatJSON = "json"
@ -23,7 +30,7 @@ const (
defaultSamplingThereafter = 100
)
func gRPCLogger(l *zap.Logger) grpclog.LoggerV2 {
func gRPCLogger(l *zap.Logger) logger {
log := l.WithOptions(
// skip gRPCLog + zapLogger in caller
zap.AddCallerSkip(2))