lib/logger: prettify logging the defined command-line flags

This commit is contained in:
Aliaksandr Valialkin 2022-08-07 22:58:29 +03:00
parent 7a1a95fd3e
commit fd1ac20760
No known key found for this signature in database
GPG key ID: A72BEC6CD3D0DED1

View file

@ -10,13 +10,13 @@ import (
func logAllFlags() {
Infof("build version: %s", buildinfo.Version)
Infof("command line flags")
Infof("command-line flags")
flag.Visit(func(f *flag.Flag) {
lname := strings.ToLower(f.Name)
value := f.Value.String()
if flagutil.IsSecretFlag(lname) {
value = "secret"
}
Infof("flag %q=%q", f.Name, value)
Infof(" -%s=%q", f.Name, value)
})
}