From d93639238cd005ae4ac2be9b9dedf7183095f251 Mon Sep 17 00:00:00 2001 From: Vladimir Kuznichenkov Date: Fri, 16 Aug 2019 10:13:43 +0300 Subject: [PATCH] Add additional logging --- alerts.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/alerts.go b/alerts.go index 4bb622fa..ff5220cf 100644 --- a/alerts.go +++ b/alerts.go @@ -73,6 +73,7 @@ func (alert Alert) PostMessage() (string, string, []slack.Block) { options := make([]slack.MsgOption, 0) if alert.Status == AlertStatusFiring || alert.MessageTS == "" { + log.Print("Composing full message") messageBlocks, err := ComposeMessageBody( alert, viper.GetString("message_template"), @@ -85,8 +86,10 @@ func (alert Alert) PostMessage() (string, string, []slack.Block) { options = append(options, slack.MsgOptionBlocks(messageBlocks...)) if alert.MessageTS != "" { options = append(options, slack.MsgOptionBroadcast()) + log.Print("Adding broadcast flag to message") } } else { + log.Print("Composing short update message") messageBody, err := ComposeResolveUpdateBody( alert, viper.GetString("header_template"), @@ -97,6 +100,7 @@ func (alert Alert) PostMessage() (string, string, []slack.Block) { } if alert.MessageTS != "" { + log.Printf("MessageTS founded, posting to thread: %s", alert.MessageTS) options = append(options, slack.MsgOptionTS(alert.MessageTS)) updateBlocks := alert.MessageBody