Skip to content

Commit

Permalink
embed: only discard infos when debug flag is off
Browse files Browse the repository at this point in the history
Signed-off-by: Gyuho Lee <gyuhox@gmail.com>
  • Loading branch information
gyuho committed Dec 21, 2017
1 parent be40d27 commit 39d0e9c
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion embed/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -268,8 +268,11 @@ func (cfg *Config) SetupLogging() {
if cfg.Debug {
capnslog.SetGlobalLogLevel(capnslog.DEBUG)
grpc.EnableTracing = true
// enable info, warning, error
grpclog.SetLoggerV2(grpclog.NewLoggerV2(os.Stderr, os.Stderr, os.Stderr))
} else {
grpclog.SetLoggerV2(grpclog.NewLoggerV2(ioutil.Discard, ioutil.Discard, ioutil.Discard))
// only discard info
grpclog.SetLoggerV2(grpclog.NewLoggerV2(ioutil.Discard, os.Stderr, os.Stderr))
}
if cfg.LogPkgLevels != "" {
repoLog := capnslog.MustRepoLogger("github.com/coreos/etcd")
Expand Down

0 comments on commit 39d0e9c

Please sign in to comment.