diff options
author | Collin Guarino <collin.guarino@gmail.com> | 2016-02-06 12:04:11 -0500 |
---|---|---|
committer | Collin Guarino <collin.guarino@gmail.com> | 2016-02-06 12:04:11 -0500 |
commit | dd56e79fa26cc8caca596f4de4a0099b375c94d4 (patch) | |
tree | cad235e9f2c252a384f1eba7d5c5fd1889c67f7e /bridge.go | |
parent | 9017b157aa97e6690cf242c38112edb32568b6c8 (diff) |
Improved log formatting with line separators.
Diffstat (limited to 'bridge.go')
-rw-r--r-- | bridge.go | 6 |
1 files changed, 4 insertions, 2 deletions
@@ -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 } |