Skip to content

Commit

Permalink
Don't pollute output in TestSetLoggerProvider
Browse files Browse the repository at this point in the history
  • Loading branch information
MrAlias committed Mar 18, 2024
1 parent e76df8c commit e07d073
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions log/internal/global/state_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
)
Expand All @@ -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)
Expand Down

0 comments on commit e07d073

Please sign in to comment.