From 7e892859c30bb968221ab3b829707d309dbac31f Mon Sep 17 00:00:00 2001 From: ekzyis Date: Mon, 12 Jun 2023 23:58:02 +0200 Subject: [PATCH] Better logging --- main.go | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/main.go b/main.go index 0117283..faa2d57 100644 --- a/main.go +++ b/main.go @@ -25,6 +25,7 @@ func WaitUntilNextMinute() { func CheckNotifications() { var prevHasNewNotes bool for { + log.Println("Checking notifications ...") hasNewNotes, err := sn.CheckNotifications() if err != nil { SendErrorToDiscord(err) @@ -32,9 +33,9 @@ func CheckNotifications() { if !prevHasNewNotes && hasNewNotes { // only send embed on "rising edge" SendNotificationsEmbedToDiscord() - log.Println("Forwarded to monitoring") + log.Println("Forwarded notifications to monitoring") } else if hasNewNotes { - log.Println("Already forwarded") + log.Println("Notifications already forwarded") } } prevHasNewNotes = hasNewNotes @@ -61,12 +62,12 @@ func main() { var dupesErr *sn.DupesError if errors.As(err, &dupesErr) { // SendDupesErrorToDiscord(story.ID, dupesErr) + log.Println(dupesErr) continue } SendErrorToDiscord(err) continue } - log.Println("Posting to SN ... OK") } WaitUntilNextHour() }