improved logging

This commit is contained in:
Niklas 2020-10-10 00:35:38 +02:00
parent 53760b6211
commit c44b22419d

View File

@ -49,7 +49,6 @@ func listenToPushEvents(url string, c chan messageType) {
return
}
log.Printf("Message: %s %s\n", result.Title, result.Message)
c <- result
}
}
@ -175,6 +174,7 @@ func parseArgs() (string, string) {
func main() {
hostname, token := parseArgs()
log.Printf("Starting on: %s", hostname)
u := url.URL{Scheme: "wss", Host: hostname, Path: "/stream"}
@ -192,6 +192,7 @@ func main() {
go listenToPushEvents(u.String()+"?"+param.Encode(), push)
for pushMessage := range push {
log.Printf("Message: %s | %s\n", pushMessage.Title, pushMessage.Message)
go sendNotification(dbusConn, pushMessage, hostname, token)
}
}