heimdall
heimdall copied to clipboard
Consider migration from ZeroLog to slog
Preflight checklist
- [X] I agree to follow this project's Code of Conduct.
- [X] I have read and am following this repository's Contribution Guidelines."
- [ ] I have discussed this feature request with the community.
Describe the background of your feature request
Until recently, there was no logging framework shipped with the go language. zerolog, used by heimdall is most probably the fastest one out there. Even it allows creation of structured log events, there are some limitations:
- ~The possible structure is flat. Adhering to e.g. the OpenTelemetry Data Model might be impossible.~ In the meantime, there is a way to achieve more sophisticated structured logging using sub-dictionary
- There is no possibility to define custom log levels, e.g. to have an
ACCESSlog level or similar, allowing for better filtering of log events emitted by heimdall.
Describe your idea
The new slog package introduced with go 1.23 supports not only those use cases, currently used by heimdall to emit log events, but also those, where zerolog is limited.
Even slog seems to be slower compared to zerolog, it is expected to be much more prominent in the future and also easier to integrate with logging interfaces used in existing packages via adapters.
For these reasons, migration to slog should be considered.
Are there any workarounds or alternatives?
stay with zerolog
Version
v0.11.1-alpha
Additional Context
No response