-
Notifications
You must be signed in to change notification settings - Fork 81
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
A LogSink may implement this additional interface if it wants to support logging through slog better. Doing so addresses several issues: - stack unwinding gets avoided in favor of logging the pre-recorded PC - proper grouping of key/value pairs via WithGroup - verbosity levels > slog.LevelInfo can be recorded - less overhead A LogSink implementation which wants to provide a `New*Handler() slog.Handler` function can either implement a second type (required because the prototype of the Enabled method conflicts) or use `logr.NewSlogHandler`. The latter is better because then conversion back-and-forth works. The overhead for the additional wrapper should be minimal.
- Loading branch information
Showing
3 changed files
with
138 additions
and
39 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters