Skip to content

Commit

Permalink
Fixes intelsdi-x#1438, set log level for logs from grpc to user defined
Browse files Browse the repository at this point in the history
  • Loading branch information
katarzyna-z committed Mar 6, 2017
1 parent 96d9c6a commit 733aa08
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions snapteld.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ import (
"github.com/intelsdi-x/snap/mgmt/tribe/agreement"
"github.com/intelsdi-x/snap/pkg/cfgfile"
"github.com/intelsdi-x/snap/scheduler"
"google.golang.org/grpc/grpclog"
)

var (
Expand Down Expand Up @@ -287,6 +288,12 @@ func action(ctx *cli.Context) error {

// Switch log level to user defined
log.SetLevel(getLevel(cfg.LogLevel))

// Set log level for logs from grpc to user defined
grpcLogger := log.New()
grpcLogger.Level = getLevel(cfg.LogLevel)
grpclog.SetLogger(grpcLogger)

log.Info("setting log level to: ", l[cfg.LogLevel])

log.Info("Starting snapteld (version: ", gitversion, ")")
Expand Down

0 comments on commit 733aa08

Please sign in to comment.