Skip to content

Commit

Permalink
Merge pull request #360 from DopplerHQ/request-log
Browse files Browse the repository at this point in the history
chore: log request before performing request
  • Loading branch information
Piccirello authored Jan 17, 2023
2 parents b62cc7d + e09f7a0 commit 12428ea
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion pkg/http/http.go
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,8 @@ func performRequest(req *http.Request, verifyTLS bool, params []queryParam) (int
Proxy: http.ProxyURL(proxyUrl),
}

utils.LogDebug(fmt.Sprintf("Performing HTTP %s to %s", req.Method, req.URL))

startTime := time.Now()
var response *http.Response
response = nil
Expand All @@ -231,7 +233,6 @@ func performRequest(req *http.Request, verifyTLS bool, params []queryParam) (int

response = resp

utils.LogDebug(fmt.Sprintf("Performing HTTP %s to %s", req.Method, req.URL))
if requestID := resp.Header.Get("x-request-id"); requestID != "" {
utils.LogDebug(fmt.Sprintf("Request ID %s", requestID))
}
Expand Down

0 comments on commit 12428ea

Please sign in to comment.