mirror of
https://github.com/VictoriaMetrics/VictoriaMetrics.git
synced 2024-11-21 14:44:00 +00:00
lib/logger: show only explicitly set command-line flags in logs
This reduces initial verbosity in logs
This commit is contained in:
parent
acfda6d8fd
commit
d0e7c0535e
1 changed files with 1 additions and 9 deletions
|
@ -11,20 +11,12 @@ import (
|
|||
func logAllFlags() {
|
||||
Infof("build version: %s", buildinfo.Version)
|
||||
Infof("command line flags")
|
||||
isSetMap := make(map[string]bool)
|
||||
flag.Visit(func(f *flag.Flag) {
|
||||
isSetMap[f.Name] = true
|
||||
})
|
||||
flag.VisitAll(func(f *flag.Flag) {
|
||||
lname := strings.ToLower(f.Name)
|
||||
value := f.Value.String()
|
||||
if flagutil.IsSecretFlag(lname) {
|
||||
value = "secret"
|
||||
}
|
||||
isSet := "false"
|
||||
if isSetMap[f.Name] {
|
||||
isSet = "true"
|
||||
}
|
||||
Infof("flag %q=%q (is_set=%s)", f.Name, value, isSet)
|
||||
Infof("flag %q=%q", f.Name, value)
|
||||
})
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue