Skip to content

Commit

Permalink
task: add logging
Browse files Browse the repository at this point in the history
  • Loading branch information
cngJo committed Aug 2, 2022
1 parent b9d95fa commit e0b1fa0
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -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{})
Expand Down

0 comments on commit e0b1fa0

Please sign in to comment.