mirror of
https://github.com/VictoriaMetrics/VictoriaMetrics.git
synced 2024-11-23 20:37:12 +01:00
23 lines
537 B
Go
23 lines
537 B
Go
|
package logger
|
||
|
|
||
|
import (
|
||
|
"flag"
|
||
|
"strings"
|
||
|
|
||
|
"github.com/VictoriaMetrics/VictoriaMetrics/lib/buildinfo"
|
||
|
)
|
||
|
|
||
|
func logAllFlags() {
|
||
|
Infof("build version: %s", buildinfo.Version)
|
||
|
Infof("command line flags")
|
||
|
flag.VisitAll(func(f *flag.Flag) {
|
||
|
lname := strings.ToLower(f.Name)
|
||
|
value := f.Value.String()
|
||
|
if strings.Contains(lname, "pass") || strings.Contains(lname, "key") || strings.Contains(lname, "secret") {
|
||
|
// Do not expose passwords and keys to prometheus.
|
||
|
value = "secret"
|
||
|
}
|
||
|
Infof("flag %q = %q", f.Name, value)
|
||
|
})
|
||
|
}
|