diff --git a/pkg/client/request.go b/pkg/client/request.go index eb6cad9109c..4219b7fc1d4 100644 --- a/pkg/client/request.go +++ b/pkg/client/request.go @@ -62,7 +62,7 @@ type UnexpectedStatusError struct { // Error returns a textual description of 'u'. func (u *UnexpectedStatusError) Error() string { - return fmt.Sprintf("request [%#v] failed (%d) %s: %s", u.Request, u.Response.StatusCode, u.Response.Status, u.Body) + return fmt.Sprintf("request [%+v] failed (%d) %s: %s", u.Request, u.Response.StatusCode, u.Response.Status, u.Body) } // RequestConstructionError is returned when there's an error assembling a request. @@ -242,7 +242,7 @@ func (r *Request) Body(obj interface{}) *Request { } r.body = bytes.NewBuffer(data) default: - r.err = fmt.Errorf("unknown type used for body: %#v", obj) + r.err = fmt.Errorf("unknown type used for body: %+v", obj) } return r } @@ -309,7 +309,7 @@ func (r *Request) Watch() (watch.Interface, error) { if resp.Body != nil { body, _ = ioutil.ReadAll(resp.Body) } - return nil, fmt.Errorf("for request '%v', got status: %v\nbody: %v", req.URL, resp.StatusCode, string(body)) + return nil, fmt.Errorf("for request '%+v', got status: %v\nbody: %v", req.URL, resp.StatusCode, string(body)) } return watch.NewStreamWatcher(watchjson.NewDecoder(resp.Body, r.codec)), nil } diff --git a/pkg/httplog/log.go b/pkg/httplog/log.go index 6350dec0ce4..f66605bc324 100644 --- a/pkg/httplog/log.go +++ b/pkg/httplog/log.go @@ -168,8 +168,8 @@ func (rl *respLogger) Write(b []byte) (int, error) { func (rl *respLogger) Flush() { if flusher, ok := rl.w.(http.Flusher); ok { flusher.Flush() - } else { - glog.V(2).Infof("Unable to convert %v into http.Flusher", rl.w) + } else if glog.V(2) { + glog.InfoDepth(1, fmt.Sprintf("Unable to convert %+v into http.Flusher", rl.w)) } }