Skip to content

Simplify the Logger interface #80

Description

@matthewmueller

Is your feature request related to a problem? Please describe.

Hey there, thanks for modernizing this library!

Currently the Logger interface looks like this:

type logger interface {
	Fatal(v ...interface{})
	Fatalf(format string, v ...interface{})
	Fatalln(v ...interface{})
	Panic(v ...interface{})
	Panicf(format string, v ...interface{})
	Panicln(v ...interface{})
	Print(v ...interface{})
	Printf(format string, v ...interface{})
	Println(v ...interface{})
}

But the library itself only uses Printf. Since this interface isn't compatible with the new *slog.Logger it requires wrapping.

Ideally, we wouldn't have to wrap all these methods, just the ones that the library uses

Describe the solution you'd like
A clear and concise description of what you want to happen.

I'd suggest reducing the Logger interface to what's necessary:

type logger interface {
  Printf(format string, v ...interface{})
}

And perhaps any other methods to future-proof it (seems like there's another issue to log errors).

Describe alternatives you've considered
Current alternative is to wrap it.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions