gdgvda / cron

a cron library for go

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

consider a logging API refactor

janrnc opened this issue · comments

An io.Writer is very generic but would also imply losing some features such as log levels and structured logging. In general, the format could be potentially inconsistent across logs coming from different subsystems.

Looking for alternatives, I've found that log/slog seems to address the common logging interface topic by providing a frontend/backend decoupled design. The frontend can be backed by any logging system implementing slog.Handler.

Considering also that it's part of the standard library, I think it could be a good replacement for the current logger interface that cron requires.

https://go.dev/blog/slog
https://www.youtube.com/watch?v=gd_Vyb5vEw0