Respect EnableLogRedacting config when pretty printing configuration

This commit is contained in:
Deluan 2021-05-30 16:01:36 -04:00
parent 7b05c49215
commit ead2095dd0
1 changed files with 6 additions and 1 deletions

View File

@ -117,8 +117,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