Skip to content

Replace Logger interface with slog.Logger #182

@iwarapter

Description

@iwarapter

The current log implementation uses a custom interface to expose a logger:

// Logger defines an interface for logging errors.
type Logger interface {
	Error(args ...interface{})
}

type noopLogger struct{}

func (noopLogger) Error(...interface{}) {}

With go 1.21 a structured log package was introduced - https://go.dev/blog/slog

Would you accept a PR that swaps out the existing logger for a *slog.Logger and updating all the relevant internal calls to be context based. I'm happy to work on this if it's likely to be accepted.

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