File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -3,6 +3,7 @@ package cmd
33import (
44 "context"
55 "fmt"
6+ globalLogging "github.com/sensu/sensu-go/util/logging"
67 "io"
78 "log"
89 "net/http"
@@ -368,6 +369,12 @@ func StartCommand(initialize InitializeFunc) *cobra.Command {
368369 }
369370 }
370371
372+ // initialize global log level registry
373+ if viper .GetString (flagLogLevel ) != "" {
374+ globalLogging .InitLogLevel (viper .GetString (flagLogLevel ))
375+ globalLogging .SetAllLoggersLevel (viper .GetString (flagLogLevel ))
376+ }
377+
371378 if viper .GetBool (flagLogMillisecondTime ) {
372379 cfg .EtcdLogTimestampLayout = timestampFormatMillisecond
373380 }
@@ -676,7 +683,7 @@ func flagSet(server bool) *pflag.FlagSet {
676683 _ = flagSet .String (flagEventLogBufferWait , "10ms" , "full buffer wait time" )
677684 }
678685
679- flagSet .SetOutput (ioutil .Discard )
686+ flagSet .SetOutput (io .Discard )
680687
681688 return flagSet
682689}
You can’t perform that action at this time.
0 commit comments