forked from toolshed/abra
feat: print stack traces for errors when debugging
This commit is contained in:
@ -9,6 +9,7 @@ import (
|
||||
"coopcloud.tech/abra/cli/catalogue"
|
||||
"coopcloud.tech/abra/cli/recipe"
|
||||
"coopcloud.tech/abra/cli/server"
|
||||
logrus_stack "github.com/Gurpartap/logrus-stack"
|
||||
"github.com/sirupsen/logrus"
|
||||
"github.com/urfave/cli/v2"
|
||||
)
|
||||
@ -76,6 +77,9 @@ func RunApp(version, commit string) {
|
||||
app.Before = func(c *cli.Context) error {
|
||||
if Debug {
|
||||
logrus.SetLevel(logrus.DebugLevel)
|
||||
logrus.SetFormatter(&logrus.TextFormatter{})
|
||||
logrus.SetOutput(os.Stderr)
|
||||
logrus.AddHook(logrus_stack.StandardHook())
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
Reference in New Issue
Block a user