Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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 join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant