Skip to content

Commit

Permalink
Add additional logging
Browse files Browse the repository at this point in the history
  • Loading branch information
kuzaxak committed Aug 16, 2019
1 parent 6b1f382 commit d936392
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions alerts.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"),
Expand All @@ -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"),
Expand All @@ -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
Expand Down

0 comments on commit d936392

Please sign in to comment.