diff --git a/log/internal/global/state_test.go b/log/internal/global/state_test.go index a03947400a67..03e4d39ba719 100644 --- a/log/internal/global/state_test.go +++ b/log/internal/global/state_test.go @@ -7,8 +7,10 @@ import ( "sync" "testing" + "github.com/go-logr/logr/testr" "github.com/stretchr/testify/assert" + "go.opentelemetry.io/otel/internal/global" "go.opentelemetry.io/otel/log" "go.opentelemetry.io/otel/log/noop" ) @@ -21,6 +23,8 @@ func TestSetLoggerProvider(t *testing.T) { t.Run("Set With default is a noop", func(t *testing.T) { t.Cleanup(reset) + + global.SetLogger(testr.New(t)) // Don't pollute output. SetLoggerProvider(GetLoggerProvider()) provider, ok := GetLoggerProvider().(*loggerProvider)