Make HTTP output less verbose

It will act same with —debug flag
This commit is contained in:
Leonid Bugaev
2017-02-07 13:33:45 +03:00
parent 6a48882125
commit 858dfaac78
+8 -1
View File
@@ -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)
@@ -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
}