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)
|
2022-08-07 21:58:29 +02:00
|
|
|
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"
|
|
|
|
}
|
2022-08-07 21:58:29 +02:00
|
|
|
Infof(" -%s=%q", f.Name, value)
|
2019-05-22 23:16:55 +02:00
|
|
|
})
|
|
|
|
}
|