blob: 2d726c7f76bd46a999346e5cc36e320f98fee4dc (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
|
package main
import (
"github.com/sirupsen/logrus"
"google.golang.org/grpc/grpclog"
)
// grpc's default logger is *very* noisy and uses "info" and even "warn" level logging for mostly useless messages.
// This function configures the grpc logger to step down the severity of all messages.
//
// info => trace
// warn => debug
// error => warn
func configureGRPCLog() {
l := logrus.WithField("library", "grpc")
grpclog.SetLoggerV2(grpclog.NewLoggerV2(l.WriterLevel(logrus.TraceLevel), l.WriterLevel(logrus.DebugLevel), l.WriterLevel(logrus.WarnLevel)))
}
|