diff --git a/handler.go b/handler.go index 3d01112..878dfa1 100644 --- a/handler.go +++ b/handler.go @@ -417,7 +417,7 @@ func (h *handler) appendValue(buf *buffer, v slog.Value, quote bool) { } } -func (h *handler) appendTintError(buf *buffer, err error, attrKey, groupsPrefix string) { +func (h *handler) appendTintError(buf *buffer, err tintError, attrKey, groupsPrefix string) { buf.WriteStringIf(!h.noColor, ansiBrightRedFaint) appendString(buf, groupsPrefix+attrKey, true) buf.WriteByte('=') diff --git a/handler_test.go b/handler_test.go index 3abae98..ee20c37 100644 --- a/handler_test.go +++ b/handler_test.go @@ -558,6 +558,14 @@ func BenchmarkLogAttrs(b *testing.B) { ) }, }, + { + "error", + func(logger *slog.Logger) { + logger.LogAttrs(context.TODO(), slog.LevelError, testMessage, + tint.Err(errTest), + ) + }, + }, } for _, h := range handler {