Add flag to enable TRACE logging
@@ -32,11 +32,17 @@ func mainErr() error {
app.Version = VERSION
app.Usage = "Rancher Kubernetes Engine, an extremely simple, lightning fast Kubernetes installer that works everywhere"
app.Before = func(ctx *cli.Context) error {
+ if ctx.GlobalBool("quiet") {
+ logrus.SetOutput(ioutil.Discard)
+ } else {
if ctx.GlobalBool("debug") {
logrus.SetLevel(logrus.DebugLevel)
+ logrus.Debugf("Loglevel set to [%v]", logrus.DebugLevel)
+ }
+ if ctx.GlobalBool("trace") {
+ logrus.SetLevel(logrus.TraceLevel)
+ logrus.Tracef("Loglevel set to [%v]", logrus.TraceLevel)
}
- if ctx.GlobalBool("quiet") {
- logrus.SetOutput(ioutil.Discard)
}
if released.MatchString(app.Version) {
metadata.RKEVersion = app.Version
@@ -65,6 +71,10 @@ func mainErr() error {
Name: "quiet,q",
Usage: "Quiet mode, disables logging and only critical output will be printed",
},
+ cli.BoolFlag{
+ Name: "trace",
+ Usage: "Trace logging",
+ },
}
return app.Run(os.Args)
}
