Skip to content

Commit 97a8180

Browse files
committed
fix log
Signed-off-by: Jessica Xie <[email protected]>
1 parent dfdeef1 commit 97a8180

File tree

3 files changed

+3
-8
lines changed

3 files changed

+3
-8
lines changed

cmd/main_test.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ import (
2222
"strings"
2323
"testing"
2424

25-
"github.com/go-kit/log"
2625
"github.com/prometheus-community/json_exporter/config"
2726
pconfig "github.com/prometheus/common/config"
2827
"github.com/prometheus/common/promslog"
@@ -190,7 +189,9 @@ func TestIgnoreMissingValues(t *testing.T) {
190189
req := httptest.NewRequest("GET", "http://example.com/foo"+"?module="+test.Module+"&target="+target.URL+test.ServeFile, nil)
191190
recorder := httptest.NewRecorder()
192191
logBuffer := strings.Builder{}
193-
probeHandler(recorder, req, log.NewLogfmtLogger(&logBuffer), c)
192+
promslogConfig := &promslog.Config{Writer: &logBuffer}
193+
logger := promslog.New(promslogConfig)
194+
probeHandler(recorder, req, logger, c)
194195

195196
if test.ShouldSucceed && logBuffer.Len() > 0 {
196197
t.Fatalf("Ignore missing values test %d (module: %s) fails unexpectedly.\nLOG:\n%s", i, test.Module, logBuffer.String())

go.mod

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,6 @@ require (
2020
github.com/beorn7/perks v1.0.1 // indirect
2121
github.com/cespare/xxhash/v2 v2.3.0 // indirect
2222
github.com/coreos/go-systemd/v22 v22.6.0 // indirect
23-
github.com/go-kit/log v0.2.1 // indirect
24-
github.com/go-logfmt/logfmt v0.5.1 // indirect
2523
github.com/golang-jwt/jwt/v5 v5.3.0 // indirect
2624
github.com/google/uuid v1.6.0 // indirect
2725
github.com/huandu/xstrings v1.5.0 // indirect

go.sum

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,6 @@ github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c
2121
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
2222
github.com/frankban/quicktest v1.14.6 h1:7Xjx+VpznH+oBnejlPUj8oUpdxnVs4f8XU8WnHkI4W8=
2323
github.com/frankban/quicktest v1.14.6/go.mod h1:4ptaffx2x8+WTWXmUCuVU6aPUX1/Mz7zb5vbUoiM6w0=
24-
github.com/go-kit/log v0.2.1 h1:MRVx0/zhvdseW+Gza6N9rVzU/IVzaeE1SFI4raAhmBU=
25-
github.com/go-kit/log v0.2.1/go.mod h1:NwTd00d/i8cPZ3xOwwiv2PO5MOcx78fFErGNcVmBjv0=
26-
github.com/go-logfmt/logfmt v0.5.1 h1:otpy5pqBCBZ1ng9RQ0dPu4PN7ba75Y/aA+UpowDyNVA=
27-
github.com/go-logfmt/logfmt v0.5.1/go.mod h1:WYhtIu8zTZfxdn5+rREduYbwxfcBr/Vr6KEVveWlfTs=
2824
github.com/golang-jwt/jwt/v5 v5.3.0 h1:pv4AsKCKKZuqlgs5sUmn4x8UlGa0kEVt/puTpKx9vvo=
2925
github.com/golang-jwt/jwt/v5 v5.3.0/go.mod h1:fxCRLWMO43lRc8nhHWY6LGqRcf+1gQWArsqaEUEa5bE=
3026
github.com/google/go-cmp v0.7.0 h1:wk8382ETsv4JYUZwIsn6YpYiWiBsYLSJiTsyBybVuN8=

0 commit comments

Comments
 (0)