Skip to content

Commit

Permalink
Make HTTP output less verbose
Browse files Browse the repository at this point in the history
It will act same with —debug flag
  • Loading branch information
buger committed Feb 7, 2017
1 parent 6a48882 commit 858dfaa
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion output_http.go
Expand Up @@ -173,7 +173,9 @@ func (o *HTTPOutput) Write(data []byte) (n int, err error) {
func (o *HTTPOutput) Read(data []byte) (int, error) {
resp := <-o.responses

Debug("[OUTPUT-HTTP] Received response:", string(resp.payload))
if Settings.debug {
Debug("[OUTPUT-HTTP] Received response:", string(resp.payload))
}

header := payloadHeader(ReplayedResponsePayload, resp.uuid, resp.roundTripTime, resp.startedAt)
copy(data[0:len(header)], header)
Expand All @@ -184,6 +186,11 @@ func (o *HTTPOutput) Read(data []byte) (int, error) {

func (o *HTTPOutput) sendRequest(client *HTTPClient, request []byte) {
meta := payloadMeta(request)

if Settings.debug {
Debug(meta)
}

if len(meta) < 2 {
return
}
Expand Down

0 comments on commit 858dfaa

Please sign in to comment.