From 0eb663fffe90159c8a8d63f8363eded2e352d9a2 Mon Sep 17 00:00:00 2001 From: Vasiliy Tolstov Date: Tue, 9 Apr 2024 23:46:36 +0300 Subject: [PATCH] fixup logger Signed-off-by: Vasiliy Tolstov --- util.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/util.go b/util.go index 7aeb6e8..d9fb106 100644 --- a/util.go +++ b/util.go @@ -282,7 +282,7 @@ func (h *httpClient) parseRsp(ctx context.Context, hrsp *http.Response, rsp inte buf, err = io.ReadAll(hrsp.Body) if err != nil { if h.opts.Logger.V(logger.ErrorLevel) { - h.opts.Logger.Errorf(ctx, "failed to read body: %v", err) + h.opts.Logger.Error(ctx, "failed to read body", err) } return errors.InternalServerError("go.micro.client", string(buf)) } @@ -291,13 +291,13 @@ func (h *httpClient) parseRsp(ctx context.Context, hrsp *http.Response, rsp inte cf, cerr := h.newCodec(ct) if cerr != nil { if h.opts.Logger.V(logger.DebugLevel) { - h.opts.Logger.Debugf(ctx, "response with %v unknown content-type %s %s", hrsp.Header, ct, buf) + h.opts.Logger.Debug(ctx, fmt.Sprintf("response with %v unknown content-type %s %s", hrsp.Header, ct, buf)) } return errors.InternalServerError("go.micro.client", cerr.Error()) } if h.opts.Logger.V(logger.DebugLevel) { - h.opts.Logger.Debugf(ctx, "response %s with %v", buf, hrsp.Header) + h.opts.Logger.Debug(ctx, fmt.Sprintf("response %s with %v", buf, hrsp.Header)) } // succeseful response