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

Add slog compatibility #2

@matthewmueller

Description

@matthewmueller

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions