Added logging of sent messages
This commit is contained in:
parent
b67d5218b2
commit
3a000d3e86
1 changed files with 5 additions and 0 deletions
|
|
@ -24,5 +24,10 @@ func Message(userId int64, message string) {
|
||||||
resp, err := http.Get(SendMessageUrl + "?" + paramString)
|
resp, err := http.Get(SendMessageUrl + "?" + paramString)
|
||||||
if err != nil || resp.StatusCode != http.StatusOK {
|
if err != nil || resp.StatusCode != http.StatusOK {
|
||||||
log.Print("Could not send message\n user: %lld", userId)
|
log.Print("Could not send message\n user: %lld", userId)
|
||||||
|
return
|
||||||
}
|
}
|
||||||
|
var responseBytes []byte
|
||||||
|
_, _ = resp.Body.Read(responseBytes)
|
||||||
|
log.Printf("Message sent\n user: %d\n message: %s\n server response: %s", userId, message,
|
||||||
|
string(responseBytes))
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue