Skip to content

Commit

Permalink
Update readme with notes on slog-multi middleware
Browse files Browse the repository at this point in the history
  • Loading branch information
veqryn committed Nov 26, 2023
1 parent d27cf58 commit 0d5ce8f
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -405,3 +405,14 @@ func newTraceProvider(exp sdktrace.SpanExporter) *sdktrace.TracerProvider {
)
}
```

### slog-multi Middleware
This library has a convenience method that allow it to interoperate with [github.com/samber/slog-multi](https://github.com/samber/slog-multi),
in order to easily setup slog workflows such as pipelines, fanout, routing, failover, etc.
```go
slog.SetDefault(slog.New(slogmulti.
Pipe(slogcontext.NewMiddleware(&slogcontext.HandlerOptions{})).
Pipe(slogdedup.NewOverwriteMiddleware(&slogdedup.OverwriteHandlerOptions{})).
Handler(slog.NewJSONHandler(os.Stdout, &slog.HandlerOptions{})),
))
```

0 comments on commit 0d5ce8f

Please sign in to comment.