MCPcopy Create free account
hub / github.com/coder/slog / Sink

Function Sink

sloggers/slogjson/slogjson.go:35–39  ·  view source on GitHub ↗

Sink creates a slog.Sink that writes JSON logs to the given writer. See package level docs for the format. If the writer implements Sync() error then it will be called when syncing.

(w io.Writer)

Source from the content-addressed store, hash-verified

33// If the writer implements Sync() error then
34// it will be called when syncing.
35func Sink(w io.Writer) slog.Sink {
36 return jsonSink{
37 w: syncwriter.New(w),
38 }
39}
40
41type jsonSink struct {
42 w *syncwriter.Writer

Callers 3

TestMakeFunction · 0.92
TestNoDriverValueFunction · 0.92
TestContextErrorsFunction · 0.92

Calls 1

NewFunction · 0.92

Tested by 3

TestMakeFunction · 0.74
TestNoDriverValueFunction · 0.74
TestContextErrorsFunction · 0.74