2019-05-22 23:16:55 +02:00
|
|
|
package logger
|
|
|
|
|
|
|
|
import (
|
|
|
|
"flag"
|
|
|
|
"strings"
|
|
|
|
|
|
|
|
"github.com/VictoriaMetrics/VictoriaMetrics/lib/buildinfo"
|
2020-09-16 21:34:01 +02:00
|
|
|
"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")
|
2021-07-13 14:07:59 +02:00
|
|
|
flag.Visit(func(f *flag.Flag) {
|
2019-05-22 23:16:55 +02:00
|
|
|
lname := strings.ToLower(f.Name)
|
|
|
|
value := f.Value.String()
|
2020-09-16 21:34:01 +02:00
|
|
|
if flagutil.IsSecretFlag(lname) {
|
2019-05-22 23:16:55 +02:00
|
|
|
value = "secret"
|
|
|
|
}
|
2021-10-28 10:00:49 +02:00
|
|
|
Infof("flag %q=%q", f.Name, value)
|
2019-05-22 23:16:55 +02:00
|
|
|
})
|
|
|
|
}
|