@@ -47,14 +47,16 @@ func (l *zapGrpcLogger) Println(args ...interface{}) {
47
47
l .logger .Info (fmt .Sprint (args ... ))
48
48
}
49
49
50
- // ReplaceGrpcLoggerV2 replaces the grpc_log.LoggerV2 with the provided logger.
51
- // It should be called before any gRPC functions.
50
+ // ReplaceGrpcLoggerV2 replaces the grpclog.LoggerV2 with the provided logger.
51
+ // It should be called before any gRPC functions. Logging verbosity defaults to info level.
52
+ // To adjust gRPC logging verbosity, see ReplaceGrpcLoggerV2WithVerbosity.
52
53
func ReplaceGrpcLoggerV2 (logger * zap.Logger ) {
53
54
ReplaceGrpcLoggerV2WithVerbosity (logger , 0 )
54
55
}
55
56
56
- // ReplaceGrpcLoggerV2WithVerbosity replaces the grpc_.LoggerV2 with the provided logger and verbosity.
57
+ // ReplaceGrpcLoggerV2WithVerbosity replaces the grpclog.Logger with the provided logger and verbosity.
57
58
// It should be called before any gRPC functions.
59
+ // verbosity correlates to grpclogs verbosity levels. A higher verbosity value results in less logging.
58
60
func ReplaceGrpcLoggerV2WithVerbosity (logger * zap.Logger , verbosity int ) {
59
61
zgl := & zapGrpcLoggerV2 {
60
62
logger : logger .With (SystemField , zap .Bool ("grpc_log" , true )).WithOptions (zap .AddCallerSkip (2 )),
@@ -63,7 +65,7 @@ func ReplaceGrpcLoggerV2WithVerbosity(logger *zap.Logger, verbosity int) {
63
65
grpclog .SetLoggerV2 (zgl )
64
66
}
65
67
66
- // SetGrpcLoggerV2 replaces the grpc_log.LoggerV2 with the provided logger.
68
+ // SetGrpcLoggerV2 replaces the grpc_log.Logger with the provided logger.
67
69
// It can be used even when grpc infrastructure was initialized.
68
70
func SetGrpcLoggerV2 (settable grpc_logsettable.SettableLoggerV2 , logger * zap.Logger ) {
69
71
SetGrpcLoggerV2WithVerbosity (settable , logger , 0 )
0 commit comments