From c38983a52d9c7a340d7d851b5daec0540a0e6e84 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mat=C3=BA=C5=A1=20Ollah?= Date: Fri, 24 May 2024 15:25:35 +0200 Subject: [PATCH] remove fmt.Sprintf remove fmt.Sprintf as r.Message is already a string --- handler.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/handler.go b/handler.go index 6a7a6e3..a6cc70d 100644 --- a/handler.go +++ b/handler.go @@ -104,7 +104,7 @@ func (h *Handler) Handle(_ context.Context, r slog.Record) error { }) fmt.Fprint(&bf, h.opts.MsgPrefix) - formattedMessage := fmt.Sprintf("%s", r.Message) + formattedMessage := r.Message if h.opts.MsgLength > 0 && len(attrs) > 0 { if len(formattedMessage) > h.opts.MsgLength { formattedMessage = formattedMessage[:h.opts.MsgLength-1] + "…" // Truncate and add ellipsis if too long