log status

This commit is contained in:
bakito 2021-04-18 19:31:42 +02:00
parent f8dd7e6136
commit d58c8f115e
No known key found for this signature in database
GPG key ID: FAF93C1C384DD6B4

View file

@ -107,7 +107,7 @@ func (cl *client) doGet(req *resty.Request, url string) error {
if err != nil {
return err
}
rl.With("body", string(resp.Body())).Debug("got response")
rl.With("status", resp.StatusCode(), "body", string(resp.Body())).Debug("got response")
if resp.StatusCode() != http.StatusOK {
return errors.New(resp.Status())
}
@ -124,7 +124,7 @@ func (cl *client) doPost(req *resty.Request, url string) error {
if err != nil {
return err
}
rl.With("body", string(resp.Body())).Debug("got response")
rl.With("status", resp.StatusCode(), "body", string(resp.Body())).Debug("got response")
if resp.StatusCode() != http.StatusOK {
return errors.New(resp.Status())
}