Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

consider a logging API refactor #16

Closed
janrnc opened this issue Oct 29, 2023 · 1 comment · Fixed by #19
Closed

consider a logging API refactor #16

janrnc opened this issue Oct 29, 2023 · 1 comment · Fixed by #19
Labels

Comments

@janrnc
Copy link
Member

janrnc commented Oct 29, 2023

See robfig/cron#508

@janrnc
Copy link
Member Author

janrnc commented Feb 20, 2024

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

@janrnc janrnc linked a pull request Feb 20, 2024 that will close this issue
@janrnc janrnc closed this as completed in #19 Mar 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant