func (t *APIRequestLogger) Do(req *http.Request) (*http.Response, error) {
	if t.logger.IsTraceEnabled() {
		if data, err := httputil.DumpRequest(req, true); err == nil {
			t.logger.Tracef("%s request %s", req.Method, data)
		} else {
			t.logger.Tracef("%s request DumpRequest error %s", req.Method, err.Error())
		}
	}

	resp, err := t.transport.Do(req)
	if err != nil {
		return nil, errors.Trace(err)
	}

	if t.logger.IsTraceEnabled() {
		if data, err := httputil.DumpResponse(resp, true); err == nil {
			t.logger.Tracef("%s response %s", req.Method, data)
		} else {
			t.logger.Tracef("%s response DumpResponse error %s", req.Method, err.Error())
		}
	}

	return resp, err
}
// Do performs the *http.Request and returns a *http.Response or an error
// if it fails to construct the transport.
Do performs the *http.Request and returns a *http.Response or an error
if it fails to construct the transport.
// Do performs the * http . Request and returns a * http . Response or an error // if it fails to construct the transport .
func (t *APIRequestLogger) Do(req *http.Request) (*http.Response, error) {
	if t.logger.IsTraceEnabled() {
		if data, err := httputil.DumpRequest(req, true); err == nil {
			t.logger.Tracef("%s request %s", req.Method, data)
		} else {
			t.logger.Tracef("%s request DumpRequest error %s", req.Method, err.Error())
		}
	}
	resp, err := t.transport.Do(req)
	if err != nil {
		return nil, errors.Trace(err)
	}
	if t.logger.IsTraceEnabled() {
		if data, err := httputil.DumpResponse(resp, true); err == nil {
			t.logger.Tracef("%s response %s", req.Method, data)
		} else {
			t.logger.Tracef("%s response DumpResponse error %s", req.Method, err.Error())
		}
	}
	return resp, err
}
func ( t * APIRequestLogger ) Do ( req * http . Request ) ( * http . Response , error ) { if t . logger . IsTraceEnabled ( ) { if data , err := httputil . DumpRequest ( req , true ) ; err == nil { t . logger . Tracef ( " " , req . Method , data ) } else { t . logger . Tracef ( " " , req . Method , err . Error ( ) ) } } resp , err := t . transport . Do ( req ) if err != nil { return nil , errors . Trace ( err ) } if t . logger . IsTraceEnabled ( ) { if data , err := httputil . DumpResponse ( resp , true ) ; err == nil { t . logger . Tracef ( " " , req . Method , data ) } else { t . logger . Tracef ( " " , req . Method , err . Error ( ) ) } } return resp , err }
Do performs the *http.Request and returns a *http.Response or an error
if it fails to construct the transport.
Do performs the * http . Request and returns a * http . Response or an error if it fails to construct the transport .