Skip to content

Commit

Permalink
added NewSlogLoggerWithLevelMapping (#510)
Browse files Browse the repository at this point in the history
* added NewSlogLoggerWithLevelMapping

* added docs

* gitignore hugo stuff
  • Loading branch information
roblaszczak authored Oct 27, 2024
1 parent 2b127e5 commit 573eef2
Show file tree
Hide file tree
Showing 5 changed files with 85 additions and 481 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ docs/node_modules/
docs/public/
docs/content/src-link
docs/content/middleware
docs/hugo_stats.json
*.out
*.log
.mod-cache
3 changes: 3 additions & 0 deletions docs/content/docs/getting-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -348,6 +348,9 @@ The complete example's source can be found at [/_examples/basic/3-router/main.go
To see Watermill's logs, pass any logger that implements the [LoggerAdapter](https://github.com/ThreeDotsLabs/watermill/blob/master/log.go).
For experimental development, you can use `NewStdLogger`.

Watermill provides ready-to-use `slog` adapter. You can create it with [`watermill.NewSlogLogger`](https://github.com/ThreeDotsLabs/watermill/blob/master/slog.go).
You can also map Watermill's log levels to `slog` levels with [`watermill.NewSlogLoggerWithLevelMapping`](https://github.com/ThreeDotsLabs/watermill/blob/master/slog.go).

## What's next?

For more details, see [documentation topics]({{< ref "/docs" >}}).
Expand Down
Loading

0 comments on commit 573eef2

Please sign in to comment.