Skip to content

feat(logger): migrate to slog and implement package-level wrappers #4

@joelfokou

Description

@joelfokou

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

  • zap dependency removed from go.mod.
  • L() function removed in favor of direct package calls.
  • All business logic updated to use the new simplified syntax.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions