From e976021cca558c67c2a54fcce207c5b50001cb32 Mon Sep 17 00:00:00 2001 From: Philipp Hirsch Date: Thu, 8 Oct 2020 08:53:28 +0200 Subject: [PATCH] fix behaviour of the onlyProd-flag --- slacklogger.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/slacklogger.go b/slacklogger.go index 10dc6ee..dfa686d 100644 --- a/slacklogger.go +++ b/slacklogger.go @@ -69,8 +69,10 @@ func (logger *slackLogger) LogWithName(name, text string) { func (logger *slackLogger) LogWithURL(url, text string) { message := fmt.Sprintf("env=%s: %s", logger.environment, text) - if !logger.onlyProd || !logger.isProd { + if logger.onlyProd && !logger.isProd { fmt.Println("Logging to Slack: " + message) + + return } payload := slack.Payload{