mirror of https://github.com/k3s-io/k3s
Make debug variable public to be used by wrapper programs
parent
690a4ca7a4
commit
56770ff2cc
|
@ -95,6 +95,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))
|
||||
}
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue