Skip to content

Commit a6b056c

Browse files
committed
remove zap logs and use fmt
Signed-off-by: jnathangreeg <[email protected]>
1 parent 2ec0c64 commit a6b056c

File tree

3 files changed

+4
-11
lines changed

3 files changed

+4
-11
lines changed

go.mod

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,6 @@ require (
1212
github.com/kr/pretty v0.3.1 // indirect
1313
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect
1414
github.com/rogpeppe/go-internal v1.11.0 // indirect
15-
go.uber.org/multierr v1.10.0 // indirect
16-
go.uber.org/zap v1.27.0 // indirect
1715
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c // indirect
1816
gopkg.in/yaml.v3 v3.0.1 // indirect
1917
)

go.sum

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,6 @@ github.com/rogpeppe/go-internal v1.11.0 h1:cWPaGQEPrBb5/AsnsZesgZZ9yb1OQ+GOISoDN
1818
github.com/rogpeppe/go-internal v1.11.0/go.mod h1:ddIwULY96R17DhadqLgMfk9H9tvdUzkipdSkR5nkCZA=
1919
github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk=
2020
github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo=
21-
go.uber.org/multierr v1.10.0 h1:S0h4aNzvfcFsC3dRF1jLoaov7oRaKqRGC/pUEJ2yvPQ=
22-
go.uber.org/multierr v1.10.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y=
23-
go.uber.org/zap v1.27.0 h1:aJMhYGrd5QSmlpLMr2MftRKl7t8J8PTZPA732ud/XR8=
24-
go.uber.org/zap v1.27.0/go.mod h1:GB2qFLM7cTU87MWRP2mPIjqfIDnGu+VIO4V/SdhGo2E=
2521
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
2622
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk=
2723
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q=

httputils/httphelpers.go

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ import (
1212
"time"
1313

1414
"github.com/cenkalti/backoff"
15-
"go.uber.org/zap"
1615
)
1716

1817
type IHttpClient interface {
@@ -87,22 +86,22 @@ func HttpPostWithContext(ctx context.Context, httpClient IHttpClient, fullURL st
8786
operation := func() error {
8887
req, err := http.NewRequestWithContext(ctx, "POST", fullURL, bytes.NewReader(body))
8988
if err != nil {
90-
zap.L().Error("error creating request", zap.Error(err), zap.String("line", "90"))
89+
fmt.Println("error creating request", err, "line 90")
9190
return backoff.Permanent(err)
9291
}
9392
setHeaders(req, headers)
9493

9594
resp, err = httpClient.Do(req)
9695
if err != nil {
97-
zap.L().Error("error sending request", zap.Error(err), zap.String("line", "97"))
96+
fmt.Println("error sending request", err, "line 97")
9897
return err
9998
}
10099
defer resp.Body.Close()
101100

102101
// If the status code is not 200, we will retry
103102
if resp.StatusCode != http.StatusOK {
104103
if shouldRetry(resp) {
105-
zap.L().Error("received status code", zap.Int("status_code", resp.StatusCode), zap.String("line", "105"))
104+
fmt.Println("received status code", resp.StatusCode, "line 105")
106105
return fmt.Errorf("received status code: %d", resp.StatusCode)
107106
}
108107
return backoff.Permanent(err)
@@ -117,7 +116,7 @@ func HttpPostWithContext(ctx context.Context, httpClient IHttpClient, fullURL st
117116

118117
// Run the operation with the exponential backoff policy
119118
if err = backoff.Retry(operation, expBackOff); err != nil {
120-
zap.L().Error("error sending request", zap.Error(err), zap.String("line", "121"))
119+
fmt.Println("error retrying request", err, "line 120")
121120
return resp, err
122121
}
123122

0 commit comments

Comments
 (0)