From 6dbedcfb1de41c1421d56d3ff64b7a5e09583fa2 Mon Sep 17 00:00:00 2001 From: Deluan Date: Sun, 30 May 2021 16:01:36 -0400 Subject: [PATCH] Respect EnableLogRedacting config when pretty printing configuration --- conf/configuration.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/conf/configuration.go b/conf/configuration.go index 9660b5511..559a76a9e 100644 --- a/conf/configuration.go +++ b/conf/configuration.go @@ -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