Improve logging
Anirudh Oppiliappan x@icyphox.sh
Thu, 16 Sep 2021 16:37:06 +0530
1 files changed,
2 insertions(+),
1 deletions(-)
jump to
M
main.go
→
main.go
@@ -16,12 +16,13 @@ http.HandleFunc("/webhook", func(w http.ResponseWriter, r *http.Request) {
m := mail.Mail{} json.NewDecoder(r.Body).Decode(&m) body, err := mail.MailBody(m.Parts) - log.Printf("recieved webhook: %v\n", m) + log.Printf("recieved webhook: %v\n", m.From) if err != nil { log.Println(err) } for _, u := range distinct(mail.ExtractURLs(body)) { + log.Printf("url: %s\n", u) parsedURL, err := url.Parse(u) if err != nil { log.Printf("url parse: %s\n", err)