fix #6: support LogValuer() attributes

This commit is contained in:
2024-01-22 13:44:19 +01:00
committed by T.v.Dein
parent 33798bddb3
commit 5c0aadd54a
3 changed files with 41 additions and 5 deletions

View File

@@ -75,7 +75,11 @@ func (h *Handler) Handle(ctx context.Context, r slog.Record) error {
fields := make(map[string]interface{}, r.NumAttrs())
r.Attrs(func(a slog.Attr) bool {
fields[a.Key] = a.Value.Any()
//fields[a.Key] = a.Value.Any()
a.Value = a.Value.Resolve()
wa := make(map[string]interface{})
h.appendAttr(wa, a)
fields[a.Key] = wa[a.Key]
return true
})