Problem
The current zap implementation requires calling logger.L() for every log entry which creates unnecessary boilerplate, exposes internal logger pointers and is not idiomatic.
Solution
- Replace
uber-go/zap with the standard library log/slog.
- Unexport the internal logger instance.
- Provide package-level functions (
Info, Error, Debug, Warn) to simplify the API.
Impact
| Zap |
Slog |
logger.L().Info("msg", zap.Int("id", 1)) |
logger.Info("msg", "id", 1) |
logger.L().Error("err", zap.Error(err)) |
logger.Error("err", "error", err) |
Definition of Done