2019-05-22 21:16:55 +00:00
|
|
|
package logger
|
|
|
|
|
|
|
|
import (
|
|
|
|
"flag"
|
|
|
|
"strings"
|
|
|
|
|
|
|
|
"github.com/VictoriaMetrics/VictoriaMetrics/lib/buildinfo"
|
2020-09-16 19:34:01 +00:00
|
|
|
"github.com/VictoriaMetrics/VictoriaMetrics/lib/flagutil"
|
2019-05-22 21:16:55 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
func logAllFlags() {
|
|
|
|
Infof("build version: %s", buildinfo.Version)
|
2022-08-07 19:58:29 +00:00
|
|
|
Infof("command-line flags")
|
2021-07-13 12:07:59 +00:00
|
|
|
flag.Visit(func(f *flag.Flag) {
|
2019-05-22 21:16:55 +00:00
|
|
|
lname := strings.ToLower(f.Name)
|
|
|
|
value := f.Value.String()
|
2020-09-16 19:34:01 +00:00
|
|
|
if flagutil.IsSecretFlag(lname) {
|
2019-05-22 21:16:55 +00:00
|
|
|
value = "secret"
|
|
|
|
}
|
2022-08-07 19:58:29 +00:00
|
|
|
Infof(" -%s=%q", f.Name, value)
|
2019-05-22 21:16:55 +00:00
|
|
|
})
|
|
|
|
}
|