fix(logs): add NOCOLOR option for use when exporting to greylog etc [EE-6696] (#11106)

This commit is contained in:
Matt Hook
2024-02-14 07:55:00 +13:00
committed by GitHub
parent 901549e8dd
commit cdf9197274
2 changed files with 8 additions and 1 deletions

View File

@@ -42,6 +42,13 @@ func setLoggingMode(mode string) {
TimeFormat: "2006/01/02 03:04PM",
FormatMessage: formatMessage,
})
case "NOCOLOR":
log.Logger = log.Output(zerolog.ConsoleWriter{
Out: os.Stderr,
TimeFormat: "2006/01/02 03:04PM",
FormatMessage: formatMessage,
NoColor: true,
})
case "JSON":
log.Logger = log.Output(os.Stderr)
}