aboutsummaryrefslogtreecommitdiff
path: root/bridge.go
diff options
context:
space:
mode:
authorCollin Guarino <collin.guarino@gmail.com>2016-02-06 12:04:11 -0500
committerCollin Guarino <collin.guarino@gmail.com>2016-02-06 12:04:11 -0500
commitdd56e79fa26cc8caca596f4de4a0099b375c94d4 (patch)
treecad235e9f2c252a384f1eba7d5c5fd1889c67f7e /bridge.go
parent9017b157aa97e6690cf242c38112edb32568b6c8 (diff)
Improved log formatting with line separators.
Diffstat (limited to 'bridge.go')
-rw-r--r--bridge.go6
1 files changed, 4 insertions, 2 deletions
diff --git a/bridge.go b/bridge.go
index 64e674f..e66432a 100644
--- a/bridge.go
+++ b/bridge.go
@@ -62,6 +62,7 @@ func (self *Bridge) Post(path string, params interface{}) ([]byte, io.Reader, er
trace("", err)
return []byte{}, nil, nil
}
+ log.Println("\nSending POST body: ", string(request))
// Send the request and handle the response
uri := fmt.Sprintf("http://" + self.IPAddress + path)
@@ -81,7 +82,7 @@ func (self *Bridge) Put(path string, params interface{}) ([]byte, io.Reader, err
return []byte{}, nil, err
}
//fmt.Println("\n\nPARAMS: ", params)
- log.Println("\n\nSending HTTP PUT body: ", string(data))
+ log.Println("\nSending PUT body: ", string(data))
request, err := http.NewRequest("PUT", uri, bytes.NewReader(data))
resp, err := client.Do(request)
@@ -101,7 +102,8 @@ func handleResponse(resp *http.Response) ([]byte, io.Reader, error) {
return []byte{}, nil, err
}
reader := bytes.NewReader(body)
- log.Println("Handled response: ", string(body))
+ log.Println("Handled response:\n--------------------\n", string(body) +
+ "\n--------------------\n")
return body, reader, nil
}