Make logger configurable as a stdlib compatible interface
Proposal
In order to support different logging libraries, it would be nice to have logging be an interface to something compatible with the current stdlib log package.
For example:
import "log"
type Logger interface {
Fatalf(format string, v ...interface{})
Errorf(format string, v ...interface{})
Warnf(format string, v ...interface{})
Infof(format string, v ...interface{})
Debugf(format string, v ...interface{})
}
Thank you for your proposal.
As I commented in another issue, for now, I'm still likely to use log/slog. But it is still open to change, so feel free to leave any idea about it.
But I need to figure out the interface-type logger. I think just the log/slog package would satisfy almost every case since there are already a lot of ecosystems built on top of log/slog.Handler for adapting third-party loggers. IMHO, only log/slog could be a logger that everyone agrees on like gofmt.
https://github.com/KimMachineGun/automemlimit/issues/5#issuecomment-1892329832
As I commented, v0.6.0 has been released with log/slog.
This issue is closed, but feel free to reopen it if you need further discussion about it.