diff --git a/pkg/cli/cmds/log.go b/pkg/cli/cmds/log.go index 28726b77a0..f18f6f08bf 100644 --- a/pkg/cli/cmds/log.go +++ b/pkg/cli/cmds/log.go @@ -103,6 +103,6 @@ func runWithLogging() error { func setupLogging() { flag.Set("v", strconv.Itoa(LogConfig.VLevel)) flag.Set("vmodule", LogConfig.VModule) - flag.Set("alsologtostderr", strconv.FormatBool(debug)) - flag.Set("logtostderr", strconv.FormatBool(!debug)) + flag.Set("alsologtostderr", strconv.FormatBool(Debug)) + flag.Set("logtostderr", strconv.FormatBool(!Debug)) } diff --git a/pkg/cli/cmds/root.go b/pkg/cli/cmds/root.go index c612ef3740..387f79882a 100644 --- a/pkg/cli/cmds/root.go +++ b/pkg/cli/cmds/root.go @@ -10,7 +10,7 @@ import ( ) var ( - debug bool + Debug bool ) func init() { @@ -32,13 +32,13 @@ func NewApp() *cli.App { cli.BoolFlag{ Name: "debug", Usage: "Turn on debug logs", - Destination: &debug, + Destination: &Debug, EnvVar: "K3S_DEBUG", }, } app.Before = func(ctx *cli.Context) error { - if debug { + if Debug { logrus.SetLevel(logrus.DebugLevel) } return nil