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