From e0b1fa0faab1bc2c4958f3716e0fa2e83494e36f Mon Sep 17 00:00:00 2001 From: Johannes Przymusinski Date: Tue, 2 Aug 2022 21:36:21 +0200 Subject: [PATCH] task: add logging --- main.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/main.go b/main.go index 7592378..35cb16c 100644 --- a/main.go +++ b/main.go @@ -98,10 +98,13 @@ func main() { // TODO: Proper error handling count, err := countMailsInMailbox(mailbox) if err != nil { + log.Printf("Cound not load mailbox data: %v", err) http.Error(w, fmt.Sprintf("Cound not load mailbox data: %v", err), http.StatusInternalServerError) return } + log.Printf("Loaded mail count for mailbox %s: %d", mailbox, count) + probeCountGauge.Set(float64(count)) h := promhttp.HandlerFor(registry, promhttp.HandlerOpts{})