Skip to content

Commit

Permalink
Replace buflogr with funcr
Browse files Browse the repository at this point in the history
  • Loading branch information
MrAlias committed May 30, 2023
1 parent 9dedd95 commit 4c34e6d
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions exporters/zipkin/zipkin_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,10 @@ import (

ottest "go.opentelemetry.io/otel/internal/internaltest"

"github.com/go-logr/logr/funcr"
zkmodel "github.com/openzipkin/zipkin-go/model"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"github.com/tonglil/buflogr"

"go.opentelemetry.io/otel/codes"
"go.opentelemetry.io/otel/sdk/resource"
Expand Down Expand Up @@ -372,11 +372,14 @@ func TestLogrFormatting(t *testing.T) {
args := []interface{}{"s", 1}

var buf bytes.Buffer
exp, err := New("", WithLogr(buflogr.NewWithBuffer(&buf)))
l := funcr.New(func(prefix, args string) {
buf.WriteString(fmt.Sprint(prefix, args))
}, funcr.Options{})
exp, err := New("", WithLogr(l))
require.NoError(t, err)
exp.logf(format, args...)

want := "INFO string \"s\", int 1\n"
want := "\"level\"=0 \"msg\"=\"string \\\"s\\\", int 1\""
got := buf.String()
assert.Equal(t, want, got)
}

0 comments on commit 4c34e6d

Please sign in to comment.