From a1db5d2f47ff74f647b5e80c12a85a92a73670b4 Mon Sep 17 00:00:00 2001 From: Jay Date: Thu, 6 Dec 2018 10:56:20 +0800 Subject: [PATCH] add log --- module/apis/line/line.go | 2 ++ router/google/youtube.go | 2 ++ 2 files changed, 4 insertions(+) diff --git a/module/apis/line/line.go b/module/apis/line/line.go index f6cbd4c..21c8dff 100644 --- a/module/apis/line/line.go +++ b/module/apis/line/line.go @@ -7,6 +7,7 @@ import ( "fmt" "io" "io/ioutil" + "log" "net/http" "net/url" "strings" @@ -118,6 +119,7 @@ func PushMessage(target string, message interface{}) { _, err = http.DefaultClient.Do(req) if err != nil { + log.Println("send to line error :::: ", err) return } } diff --git a/router/google/youtube.go b/router/google/youtube.go index 93255b8..99256ae 100644 --- a/router/google/youtube.go +++ b/router/google/youtube.go @@ -130,6 +130,7 @@ func GetNotifyWebhook(c *context.Context) { log.Println("group data :::: ", v, v.Notify, v.Name) if v.Notify { str := v.Tmpl + log.Println("template :::: ", str) if len(str) == 0 { str = fmt.Sprintf("%s\n%s", hook.Entry[0].Title, hook.Entry[0].Link.Href) } else { @@ -140,6 +141,7 @@ func GetNotifyWebhook(c *context.Context) { msg := &lineapi.TextMessage{ Text: str, } + log.Println("msg ::::: ", msg) lineapi.PushMessage(v.ID, msg) }