Skip to content

Commit

Permalink
Merge pull request #2 from Clarilab/fix-only-prod
Browse files Browse the repository at this point in the history
fix behaviour of the onlyProd-flag
  • Loading branch information
hanspolo authored Oct 8, 2020
2 parents 0bdf8f7 + e976021 commit 5099a31
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion slacklogger.go
Original file line number Diff line number Diff line change
Expand Up @@ -89,8 +89,10 @@ func (logger *slackLogger) LogWithChannelAndURLAndName(channel, url, name, text
func (logger *slackLogger) LogWithChannelAndURL(channel, 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{
Expand Down

0 comments on commit 5099a31

Please # to comment.