We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent fa507d2 commit 958f7ebCopy full SHA for 958f7eb
context.go
@@ -4,21 +4,15 @@ import "context"
4
5
type loggerCtxKey = struct{}
6
7
-type sinkContext struct {
8
- context.Context
9
- Sink
10
-}
11
-
12
-// SinkContext is a context that implements Sink.
13
-// It may be returned by log creators to allow for composition.
14
-type SinkContext interface {
+// SinkContext is used by slog.Make to compose many loggers together.
+type SinkContext struct {
15
Sink
16
context.Context
17
}
18
19
func contextWithLogger(ctx context.Context, l logger) SinkContext {
20
ctx = context.WithValue(ctx, loggerCtxKey{}, l)
21
- return &sinkContext{
+ return SinkContext{
22
Context: ctx,
23
Sink: l,
24
0 commit comments