VictoriaMetrics/lib/logger/flag.go

23 lines
463 B
Go
Raw Normal View History

2019-05-22 23:16:55 +02:00
package logger
import (
"flag"
"strings"
"github.com/VictoriaMetrics/VictoriaMetrics/lib/buildinfo"
"github.com/VictoriaMetrics/VictoriaMetrics/lib/flagutil"
2019-05-22 23:16:55 +02:00
)
func logAllFlags() {
Infof("build version: %s", buildinfo.Version)
Infof("command line flags")
flag.Visit(func(f *flag.Flag) {
2019-05-22 23:16:55 +02:00
lname := strings.ToLower(f.Name)
value := f.Value.String()
if flagutil.IsSecretFlag(lname) {
2019-05-22 23:16:55 +02:00
value = "secret"
}
Infof("flag %q=%q", f.Name, value)
2019-05-22 23:16:55 +02:00
})
}