File tree 1 file changed +8
-0
lines changed
1 file changed +8
-0
lines changed Original file line number Diff line number Diff line change @@ -17,6 +17,7 @@ import (
17
17
"context"
18
18
"flag"
19
19
"fmt"
20
+ "io/ioutil"
20
21
"os"
21
22
"runtime"
22
23
"strconv"
@@ -63,6 +64,7 @@ import (
63
64
"github.com/struCoder/pidusage"
64
65
"go.uber.org/automaxprocs/maxprocs"
65
66
"go.uber.org/zap"
67
+ "google.golang.org/grpc/grpclog"
66
68
)
67
69
68
70
// Flag Names
@@ -588,6 +590,12 @@ func setupLog() {
588
590
nopLog := func (string , ... interface {}) {}
589
591
_ , err = maxprocs .Set (maxprocs .Logger (nopLog ))
590
592
terror .MustNil (err )
593
+
594
+ if len (os .Getenv ("GRPC_DEBUG" )) > 0 {
595
+ grpclog .SetLoggerV2 (grpclog .NewLoggerV2WithVerbosity (os .Stderr , os .Stderr , os .Stderr , 999 ))
596
+ } else {
597
+ grpclog .SetLoggerV2 (grpclog .NewLoggerV2 (ioutil .Discard , ioutil .Discard , os .Stderr ))
598
+ }
591
599
}
592
600
593
601
func printInfo () {
You can’t perform that action at this time.
0 commit comments