From e9676881de591b02fcfda91f78c7e8fbbd910f25 Mon Sep 17 00:00:00 2001 From: Gabe Cook Date: Fri, 15 Nov 2024 18:51:09 -0600 Subject: [PATCH] feat: Log when a notification is sent --- internal/integration/integrations.go | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/internal/integration/integrations.go b/internal/integration/integrations.go index 2f5b473..7c01219 100644 --- a/internal/integration/integrations.go +++ b/internal/integration/integrations.go @@ -44,9 +44,16 @@ func Setup(ctx context.Context, conf *config.Config) (Integrations, error) { } func (i Integrations) Send(ctx context.Context, message string) { + sent := make([]string, 0, len(i)) for _, integration := range i { if err := integration.Send(ctx, message); err != nil { - slog.Error("Failed to send message", "integration", integration.Name(), "error", err) + slog.Error("Failed to notify", "integration", integration.Name(), "error", err) + continue } + sent = append(sent, integration.Name()) + } + if len(sent) != 0 { + slices.Sort(sent) + slog.Info("Sent notification", "integrations", sent) } }