git.sr.ht/~pingoo/stdx@v0.0.0-20240218134121-094174641f6e/log/slogx/attr.go (about) 1 package slogx 2 3 import ( 4 "log/slog" 5 6 "git.sr.ht/~pingoo/stdx/timex" 7 ) 8 9 func Err(err error) slog.Attr { 10 return slog.String("error", err.Error()) 11 } 12 13 func Time(key string, t timex.Time) slog.Attr { 14 return slog.String(key, t.String()) 15 }