Add more logging.

This commit is contained in:
Josh W 2020-02-10 11:00:12 -05:00
parent a38e81854f
commit ce8b9b18d5

View file

@ -62,6 +62,7 @@ end
def next_song() =
log = log(label="next_song")
log("Requesting the next song from #{url_next}")
let (status, _, data) = http.get(headers=api_headers_next, url_next)
let (_, status_code, _) = status
@ -96,7 +97,7 @@ def just_played(m) =
log = log(label="just_played")
if m["req_id"] != "" then
log("Just played request ID: "^quote(m["req_id"]))
log("Letting server know we played request ID #{m["req_id"]} here: #{url_played}")
played_song = json_of(compact=true, [("song_request", int_of_string(m["req_id"]))])
let (status, _, data) = http.post(headers=api_headers_played, data=played_song, url_played)
let (_, status_code, _) = status