We have a logger package that contains an abstraction over Go's standard slog logger. I do not see a benefit in having an interface/abstraction over slog for the following reasons:
slog (as of Go 1.26) can support multiple writers on a single logger (being released this month Feb)
- We have no foreseeable interest in ever supporting a different logger other than
slog
- The DX in the interface is actually a bit clunky, i.e. I'd prefer and argue it's cleaner and simpler to read
logger.Error("...", "err", err, "val", 4) instead of logger.Error("...", err, logger.With*(...)). In other words, just provide the variadic fields; logger.With*(...) is not necessary and just makes the code verbose.
cc @hpsing @abergasov
We have a
loggerpackage that contains an abstraction over Go's standardsloglogger. I do not see a benefit in having an interface/abstraction overslogfor the following reasons:slog(as of Go 1.26) can support multiple writers on a single logger (being released this month Feb)sloglogger.Error("...", "err", err, "val", 4)instead oflogger.Error("...", err, logger.With*(...)). In other words, just provide the variadic fields;logger.With*(...)is not necessary and just makes the code verbose.cc @hpsing @abergasov