Prometheus: (Chore) Switch from infra to sdk logger (#76827)
This commit is contained in:
@@ -4,10 +4,9 @@ import (
|
||||
"net/http"
|
||||
"testing"
|
||||
|
||||
"github.com/grafana/grafana-plugin-sdk-go/backend"
|
||||
"github.com/grafana/grafana-plugin-sdk-go/backend/httpclient"
|
||||
"github.com/stretchr/testify/require"
|
||||
|
||||
"github.com/grafana/grafana/pkg/infra/log"
|
||||
)
|
||||
|
||||
func TestEnsureHttpMethodMiddleware(t *testing.T) {
|
||||
@@ -15,7 +14,7 @@ func TestEnsureHttpMethodMiddleware(t *testing.T) {
|
||||
finalRoundTripper := httpclient.RoundTripperFunc(func(req *http.Request) (*http.Response, error) {
|
||||
return &http.Response{StatusCode: http.StatusOK}, nil
|
||||
})
|
||||
mw := ForceHttpGet(log.New("test"))
|
||||
mw := ForceHttpGet(backend.NewLoggerWith("logger", "test"))
|
||||
rt := mw.CreateMiddleware(httpclient.Options{}, finalRoundTripper)
|
||||
require.NotNil(t, rt)
|
||||
middlewareName, ok := mw.(httpclient.MiddlewareName)
|
||||
@@ -28,7 +27,7 @@ func TestEnsureHttpMethodMiddleware(t *testing.T) {
|
||||
return &http.Response{StatusCode: http.StatusOK}, nil
|
||||
})
|
||||
|
||||
mw := ForceHttpGet(log.New("test"))
|
||||
mw := ForceHttpGet(backend.NewLoggerWith("logger", "test"))
|
||||
rt := mw.CreateMiddleware(httpclient.Options{}, finalRoundTripper)
|
||||
require.NotNil(t, rt)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user