Respect EnableLogRedacting config when pretty printing configuration

This commit is contained in:
Deluan 2021-05-30 16:01:36 -04:00 committed by Joe Stump
parent daa6ccdef8
commit 6dbedcfb1d
No known key found for this signature in database
GPG Key ID: 29151C3EC48A0EB9

View File

@ -128,8 +128,13 @@ func Load() {
os.Exit(1)
}
// Print current configuration if log level is Debug
if log.CurrentLevel() >= log.LevelDebug {
fmt.Println(log.Redact(pretty.Sprintf("Loaded configuration from '%s': %# v", Server.ConfigFile, Server)))
prettyConf := pretty.Sprintf("Loaded configuration from '%s': %# v", Server.ConfigFile, Server)
if Server.EnableLogRedacting {
prettyConf = log.Redact(prettyConf)
}
fmt.Println(prettyConf)
}
// Call init hooks