added conditional logging of JSON Response

This commit is contained in:
Varun Thakur 2021-04-18 14:54:53 +05:30 committed by GitHub
parent 2f55ac63a4
commit b826e98d61
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 1 deletions

View File

@ -478,7 +478,9 @@ func (h *DefaultEventHandler) OnReceiveResponse(resp proto.Message) {
if respStr, err := h.Formatter(resp); err != nil {
fmt.Fprintf(h.Out, "Failed to format response message %d: %v\n", h.NumResponses, err)
} else {
fmt.Fprintln(h.Out, respStr)
if h.VerbosityLevel > 0 {
fmt.Fprintln(h.Out, respStr)
}
}
}