Skip to content

Commit a92ff01

Browse files
committed
SUMO-184022: Logging request and response in the same line.
1 parent 5820ba0 commit a92ff01

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

sumologic/sumologic_client.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,8 +64,7 @@ func createNewRequest(method, url string, body io.Reader, accessID string, acces
6464
func logRequestAndResponse(req *http.Request, resp *http.Response) {
6565
var maskedHeader = req.Header.Clone()
6666
maskedHeader.Set("Authorization", "xxxxxxxxxxx")
67-
log.Printf("[DEBUG] Request made to Sumo Logic: [Method=%s] [URL=%s] [Headers=%s]", req.Method, req.URL, maskedHeader)
68-
log.Printf("[DEBUG] Response received from Sumo Logic: [StatusCode=%s]", resp.Status)
67+
log.Printf("[DEBUG] Request: [Method=%s] [URL=%s] [Headers=%s]. Response: [StatusCode=%s]\n", req.Method, req.URL, maskedHeader, resp.Status)
6968
}
7069

7170
func (s *Client) PostWithCookies(urlPath string, payload interface{}) ([]byte, []*http.Cookie, error) {

0 commit comments

Comments
 (0)