Skip to content

Commit

Permalink
grpc: move gRPC INFO logs to be emitted as TRACE logs from Consul
Browse files Browse the repository at this point in the history
Fixes #10183
  • Loading branch information
rboyer committed Jun 14, 2021
1 parent 50b42c1 commit 8d871ac
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
3 changes: 2 additions & 1 deletion logging/grpc.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@ func NewGRPCLogger(logLevel string, logger hclog.Logger) *GRPCLogger {

// Info implements grpclog.LoggerV2
func (g *GRPCLogger) Info(args ...interface{}) {
g.logger.Info(fmt.Sprint(args...))
// gRPC's INFO level is more akin to Consul's TRACE level
g.logger.Trace(fmt.Sprint(args...))
}

// Infoln implements grpclog.LoggerV2
Expand Down
6 changes: 3 additions & 3 deletions logging/grpc_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,9 @@ func TestGRPCLogger(t *testing.T) {
grpclog.Errorf("Errorf: %d", 1)

// Fatal tests are hard... assume they are good!
expect := `timeformat [INFO] Info,
timeformat [INFO] Infoln
timeformat [INFO] Infof: 1
expect := `timeformat [TRACE] Info,
timeformat [TRACE] Infoln
timeformat [TRACE] Infof: 1
timeformat [WARN] Warning,
timeformat [WARN] Warningln
timeformat [WARN] Warningf: 1
Expand Down

0 comments on commit 8d871ac

Please sign in to comment.