Skip to content

Commit 14b50c2

Browse files
committed
fix: return sink from slogjson.Sink
1 parent 552693c commit 14b50c2

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

sloggers/slogjson/slogjson.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,10 @@ import (
3434
// for the format.
3535
// If the writer implements Sync() error then
3636
// it will be called when syncing.
37-
func Sink(w io.Writer) slog.Logger {
38-
return slog.Make(jsonSink{
37+
func Sink(w io.Writer) slog.Sink {
38+
return jsonSink{
3939
w: syncwriter.New(w),
40-
})
40+
}
4141
}
4242

4343
type jsonSink struct {

sloggers/slogjson/slogjson_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ func TestMake(t *testing.T) {
2424

2525
ctx, s := trace.StartSpan(bg, "meow")
2626
b := &bytes.Buffer{}
27-
l := slogjson.Sink(b)
27+
l := slog.Make(slogjson.Sink(b))
2828
l = l.Named("named")
2929
l.Error(ctx, "line1\n\nline2", slog.F("wowow", "me\nyou"))
3030

0 commit comments

Comments
 (0)