Closed rvdwijngaard closed 1 year ago
hi @rvdwijngaard
This library will centralize a few helpers for all my slog libs: much easier to maintain.
This is still WIP (until the end of the week?). I will make the readme more explicit.
Formatters should be added to samber/slog-formatter.
The slog
stdlib can support many attributes having the same key. But in my handlers, i mostly export attributes to objects.
For faster processing I convert []slog.Attr
to map[string]any
early. So this is why this lib is doing some stuff on map
instead of slog.Attr
.
Hi @samber thanks for explaining this.
Hi @samber,
This library serves the purpose of providing helper functions, such as error formatting, in a consistent manner. However, I'm having trouble understanding how it fits into the slog ecosystem.
In the slog API, the convention is to use the
Error
function with a message string as the first argument, followed by optional additional arguments for formatting purposes. However, this library uses amap[string]any
as its primary data type.Could you please clarify the purpose of this library and how it relates to the slog ecosystem? I feel like I might be missing something.