Skip to content
This repository has been archived by the owner on Nov 2, 2024. It is now read-only.

Add slog compatibility #2

Open
matthewmueller opened this issue Oct 3, 2023 · 0 comments
Open

Add slog compatibility #2

matthewmueller opened this issue Oct 3, 2023 · 0 comments

Comments

@matthewmueller
Copy link
Contributor

matthewmueller commented Oct 3, 2023

Starting in v0.0.3, I removed log/slog support.

The main reason was that you can't mock the logger you get back because it's not an interface. I also didn't like that I couldn't use Infof for certain occasions (e.g. Listening on %s).

It'd be nice to bring back compatibility for the times when you need to work with other libraries.

Thinking something like:

// Pass a fully-built logger
func Slog(log Log) *slog.Logger

// Alternatively, just pass a handler
func Slog(handler Handler) slog.Handler

Not sure which one's preferable at this time. We could use the same approach for the log package too.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant