Deprecating value "false" for config.log.standard and config.log.events

This commit is contained in:
Berengar W. Lehr 2023-09-26 14:41:51 +02:00
parent 8b22f71399
commit 5560fc7f98
2 changed files with 10 additions and 2 deletions

View File

@ -68,7 +68,11 @@ func ConfigLogger(configLogEnabled bool, configLogStandard string, configLogPath
// The backend is the part which actually handles logging the log entries somewhere.
var backend logging.Backend
backend = &NoopBackend{}
if configLogEnabled && configLogStandard != "off" && configLogStandard != "false" {
if configLogStandard == "false" {
configLogStandard = "off"
Warning("log.standard value 'false' is deprecated and will be removed in a future release. Please use the value 'off'.")
}
if configLogEnabled && configLogStandard != "off" {
logBackend := logging.NewLogBackend(GetLogWriter(configLogStandard, "standard"), "", 0)
backend = logging.NewBackendFormatter(logBackend, logging.MustStringFormatter(Fmt+"\n"))
}

View File

@ -47,7 +47,11 @@ func NewWatermillLogger(configLogEnabled bool, configLogEvents string, configLog
var backend logging.Backend
backend = &NoopBackend{}
if configLogEnabled && configLogEvents != "off" && configLogEvents != "false" {
if configLogEvents == "false" {
configLogEvents = "off"
Warning("log.events value 'false' is deprecated and will be removed in a future release. Please use the value 'off'.")
}
if configLogEnabled && configLogEvents != "off" {
logBackend := logging.NewLogBackend(GetLogWriter(configLogEvents, "events"), "", 0)
backend = logging.NewBackendFormatter(logBackend, logging.MustStringFormatter(watermillFmt+"\n"))
}