Add debugging utilities

This commit is contained in:
Hamcha 2016-02-09 10:34:59 +00:00
parent 18fe8eee60
commit b3d23a0f36
2 changed files with 2 additions and 0 deletions

View file

@ -42,6 +42,7 @@ func handleClient(c net.Conn) {
err = json.Unmarshal(bytes, &cmd) err = json.Unmarshal(bytes, &cmd)
if err != nil { if err != nil {
log.Printf("[handleClient] Can't parse JSON: %s\r\n", err.Error()) log.Printf("[handleClient] Can't parse JSON: %s\r\n", err.Error())
log.Println(string(bytes))
continue continue
} }
executeClientCommand(cmd) executeClientCommand(cmd)

View file

@ -27,6 +27,7 @@ func CreateBrokerClient(brokerAddr string, updateFn UpdateHandler) error {
err = json.Unmarshal(bytes, &update) err = json.Unmarshal(bytes, &update)
if err != nil { if err != nil {
log.Printf("[tg - CreateBrokerClient] ERROR reading JSON: %s\r\n", err.Error()) log.Printf("[tg - CreateBrokerClient] ERROR reading JSON: %s\r\n", err.Error())
log.Println(string(bytes))
} }
// Dispatch to UpdateHandler // Dispatch to UpdateHandler