Skip to content

Commit

Permalink
slogr: fix unintended API break in v0.8.0
Browse files Browse the repository at this point in the history
logr v0.7.0 had slogr.NewSlogHandler. We must keep that function for API
compatibility. https://github.com/go-logr/logr/pull/237/files#r1434203442
accidentally renamed it.
  • Loading branch information
pohly committed Dec 21, 2023
1 parent d77acf8 commit 1baa0a8
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions slogr/slogr.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,10 @@ func NewLogr(handler slog.Handler) logr.Logger {
return logr.FromSlogHandler(handler)
}

// ToSlogHandler returns a slog.Handler which writes to the same sink as the logr.Logger.
// NewSlogHandler returns a slog.Handler which writes to the same sink as the logr.Logger.
//
// Deprecated: use [logr.ToSlogHandler] instead.
func ToSlogHandler(logger logr.Logger) slog.Handler {
func NewSlogHandler(logger logr.Logger) slog.Handler {
return logr.ToSlogHandler(logger)
}

Expand Down

0 comments on commit 1baa0a8

Please sign in to comment.