Skip to content

Commit

Permalink
optimize debug log level when cannot determine the unmarshal function
Browse files Browse the repository at this point in the history
  • Loading branch information
imroc committed Sep 18, 2022
1 parent 1dff303 commit 47a82c9
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion middleware.go
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,9 @@ func unmarshalBody(c *Client, r *Response, v interface{}) (err error) {
} else if util.IsXMLType(ct) {
return c.xmlUnmarshal(body, v)
} else {
c.log.Debugf("cannot determine the unmarshal function with %q Content-Type, default to json", ct)
if c.DebugLog {
c.log.Debugf("cannot determine the unmarshal function with %q Content-Type, default to json", ct)
}
return c.jsonUnmarshal(body, v)
}
return
Expand Down

0 comments on commit 47a82c9

Please sign in to comment.