package slogr
import "github.com/go-logr/logr/slogr"
Package slogr enables usage of a slog.Handler with logr.Logger as front-end API and of a logr.LogSink through the slog.Handler and thus slog.Logger APIs.
See the README in the top-level [./logr] package for a discussion of interoperability.
Deprecated: use the main logr package instead.
Index ¶
- func NewLogr(handler slog.Handler) logr.Logger
- func NewSlogHandler(logger logr.Logger) slog.Handler
- func ToSlogHandler(logger logr.Logger) slog.Handler
- type SlogSink
Functions ¶
func NewLogr ¶
NewLogr returns a logr.Logger which writes to the slog.Handler.
Deprecated: use logr.FromSlogHandler instead.
func NewSlogHandler ¶
NewSlogHandler returns a slog.Handler which writes to the same sink as the logr.Logger.
Deprecated: use logr.ToSlogHandler instead.
func ToSlogHandler ¶
ToSlogHandler returns a slog.Handler which writes to the same sink as the logr.Logger.
Deprecated: use logr.ToSlogHandler instead.
Types ¶
type SlogSink ¶
SlogSink is an optional interface that a LogSink can implement to support logging through the slog.Logger or slog.Handler APIs better.
Deprecated: use logr.SlogSink instead.
Source Files ¶
- Version
- v1.4.2 (latest)
- Published
- May 20, 2024
- Platform
- linux/amd64
- Imports
- 2 packages
- Last checked
- 5 days ago –
Tools for package owners.