Skip to content

Commit

Permalink
feat: add directional hints for debug logs (oras-project#713)
Browse files Browse the repository at this point in the history
Resolves: oras-project#712 
Signed-off-by: Billy Zha <[email protected]>
  • Loading branch information
qweeah authored and Terry Howe committed Feb 2, 2023
1 parent 2b18320 commit e9cb5cb
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions internal/trace/transport.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,9 @@ func (t *Transport) RoundTrip(req *http.Request) (resp *http.Response, err error
ctx := req.Context()
e := Logger(ctx)

e.Debugf(" Request URL: %q", req.URL)
e.Debugf(" Request method: %q", req.Method)
e.Debugf(" Request headers:")
e.Debugf("> Request URL: %q", req.URL)
e.Debugf("> Request method: %q", req.Method)
e.Debugf("> Request headers:")
logHeader(req.Header, e)

resp, err = t.RoundTripper.RoundTrip(req)
Expand All @@ -48,8 +48,8 @@ func (t *Transport) RoundTrip(req *http.Request) (resp *http.Response, err error
} else if resp == nil {
e.Errorf("No response obtained for request %s %q", req.Method, req.URL)
} else {
e.Debugf(" Response Status: %q", resp.Status)
e.Debugf(" Response headers:")
e.Debugf("< Response Status: %q", resp.Status)
e.Debugf("< Response headers:")
logHeader(resp.Header, e)
}
return resp, err
Expand Down

0 comments on commit e9cb5cb

Please sign in to comment.