Skip to content

Commit

Permalink
슬랙 메시지 형식 변경
Browse files Browse the repository at this point in the history
  • Loading branch information
bitofsky committed Apr 17, 2024
1 parent 1d7c3ad commit bff8132
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions logger/slack.go
Original file line number Diff line number Diff line change
Expand Up @@ -97,10 +97,10 @@ func (s *Slack) start(stopCh chan struct{}) {
s.mutex.Unlock() // unlock the pool

for _, msg := range pool {
text += fmt.Sprintf("%s[%s][%s][%s:%d] %s\n", s.msgPrefix, msg.time.Format(time.RFC3339), msg.level, msg.file, msg.line, msg.msg)
text += fmt.Sprintf("```%s[%s][%s][%s:%d] %s```\n", s.msgPrefix, msg.time.Format(time.RFC3339), msg.level, msg.file, msg.line, msg.msg)
}

if err := s.send("```" + text + "```"); err != nil {
if err := s.send(text); err != nil {
klog.Errorf("error sending to slack: %s\n%s", err, text)
}
}
Expand Down

0 comments on commit bff8132

Please sign in to comment.