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 7f7b7fd
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions slogr/slogr.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,13 @@ func NewLogr(handler slog.Handler) logr.Logger {
return logr.FromSlogHandler(handler)
}

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

// ToSlogHandler returns a slog.Handler which writes to the same sink as the logr.Logger.
//
// Deprecated: use [logr.ToSlogHandler] instead.
Expand Down

0 comments on commit 7f7b7fd

Please sign in to comment.