From e372f67561038bd4708bccbc9092d4b43dbac29e Mon Sep 17 00:00:00 2001 From: Moh Achun Armando Date: Tue, 20 Jan 2026 15:27:32 +0700 Subject: [PATCH 1/2] feature: add log http response header --- http.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/http.go b/http.go index 778f681..0f774b9 100644 --- a/http.go +++ b/http.go @@ -27,6 +27,8 @@ func DoHTTPRequest[T httpResponse](ctx context.Context, httpClient *http.Client, return respStatusCode, nil, err } + logger = logger.WithField("response header", Dump(httpResp.Header)) + respInBytes, err := io.ReadAll(httpResp.Body) if err != nil { logger.Error(err) From a4cdbcbea86add62bff5d34c29b00fe73fe8ff35 Mon Sep 17 00:00:00 2001 From: Moh Achun Armando Date: Tue, 20 Jan 2026 16:29:41 +0700 Subject: [PATCH 2/2] pigx --- http.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/http.go b/http.go index 0f774b9..3857e23 100644 --- a/http.go +++ b/http.go @@ -27,7 +27,7 @@ func DoHTTPRequest[T httpResponse](ctx context.Context, httpClient *http.Client, return respStatusCode, nil, err } - logger = logger.WithField("response header", Dump(httpResp.Header)) + logger = logger.WithField("responseHeader", Dump(httpResp.Header)) respInBytes, err := io.ReadAll(httpResp.Body) if err != nil { @@ -48,5 +48,8 @@ func DoHTTPRequest[T httpResponse](ctx context.Context, httpClient *http.Client, logger.WithField("respInBytes", string(respInBytes)).Error(err) return httpResp.StatusCode, nil, err } + + logger.Info() + return httpResp.StatusCode, &resp, nil }