improved logging
This commit is contained in:
parent
53760b6211
commit
c44b22419d
3
main.go
3
main.go
@ -49,7 +49,6 @@ func listenToPushEvents(url string, c chan messageType) {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
log.Printf("Message: %s %s\n", result.Title, result.Message)
|
|
||||||
c <- result
|
c <- result
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -175,6 +174,7 @@ func parseArgs() (string, string) {
|
|||||||
func main() {
|
func main() {
|
||||||
|
|
||||||
hostname, token := parseArgs()
|
hostname, token := parseArgs()
|
||||||
|
log.Printf("Starting on: %s", hostname)
|
||||||
|
|
||||||
u := url.URL{Scheme: "wss", Host: hostname, Path: "/stream"}
|
u := url.URL{Scheme: "wss", Host: hostname, Path: "/stream"}
|
||||||
|
|
||||||
@ -192,6 +192,7 @@ func main() {
|
|||||||
go listenToPushEvents(u.String()+"?"+param.Encode(), push)
|
go listenToPushEvents(u.String()+"?"+param.Encode(), push)
|
||||||
|
|
||||||
for pushMessage := range push {
|
for pushMessage := range push {
|
||||||
|
log.Printf("Message: %s | %s\n", pushMessage.Title, pushMessage.Message)
|
||||||
go sendNotification(dbusConn, pushMessage, hostname, token)
|
go sendNotification(dbusConn, pushMessage, hostname, token)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user