Files
ocis/storage/pkg/flagset/debug.go
T

31 lines
815 B
Go
Raw Normal View History

2020-09-01 12:12:52 +02:00
package flagset
import (
"github.com/micro/cli/v2"
2020-10-05 20:39:29 +02:00
"github.com/owncloud/ocis/storage/pkg/config"
2020-09-01 12:12:52 +02:00
)
// DebugWithConfig applies common debug config cfg to the flagset
func DebugWithConfig(cfg *config.Config) []cli.Flag {
return []cli.Flag{
&cli.StringFlag{
Name: "debug-token",
Value: "",
Usage: "Token to grant metrics access",
2020-10-05 20:39:29 +02:00
EnvVars: []string{"STORAGE_DEBUG_TOKEN"},
2020-09-01 12:12:52 +02:00
Destination: &cfg.Debug.Token,
},
&cli.BoolFlag{
Name: "debug-pprof",
Usage: "Enable pprof debugging",
2020-10-05 20:39:29 +02:00
EnvVars: []string{"STORAGE_DEBUG_PPROF"},
2020-09-01 12:12:52 +02:00
Destination: &cfg.Debug.Pprof,
},
&cli.BoolFlag{
Name: "debug-zpages",
Usage: "Enable zpages debugging",
2020-10-05 20:39:29 +02:00
EnvVars: []string{"STORAGE_DEBUG_ZPAGES"},
2020-09-01 12:12:52 +02:00
Destination: &cfg.Debug.Zpages,
},
}
}