From 5560fc7f98a2de25c6efeaedeecccc9faa2524a2 Mon Sep 17 00:00:00 2001 From: "Berengar W. Lehr" Date: Tue, 26 Sep 2023 14:41:51 +0200 Subject: [PATCH] Deprecating value "false" for config.log.standard and config.log.events --- pkg/log/logging.go | 6 +++++- pkg/log/watermill_logger.go | 6 +++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/pkg/log/logging.go b/pkg/log/logging.go index 23afa4784..7a2f4e894 100644 --- a/pkg/log/logging.go +++ b/pkg/log/logging.go @@ -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")) } diff --git a/pkg/log/watermill_logger.go b/pkg/log/watermill_logger.go index 4d5cceaca..1d9e3ef69 100644 --- a/pkg/log/watermill_logger.go +++ b/pkg/log/watermill_logger.go @@ -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")) }