[bugfix] ensure std log writer passes byte slices along as string, or JSON will encode as base64 raw bytes (#4416)

Reviewed-on: https://codeberg.org/superseriousbusiness/gotosocial/pulls/4416
Co-authored-by: kim <grufwub@gmail.com>
Co-committed-by: kim <grufwub@gmail.com>
This commit is contained in:
kim 2025-09-07 16:16:06 +02:00 committed by kim
commit 4b6c65fc15

View file

@ -20,6 +20,7 @@ package log
import (
"log"
"codeberg.org/gruf/go-byteutil"
"codeberg.org/gruf/go-kv/v2"
)
@ -36,7 +37,7 @@ func (w stdLogWriter) Write(b []byte) (int, error) {
if w.lvl <= loglvl {
logf(nil, w.lvl, kv.Fields{
{K: "caller", V: Caller(5)},
{K: "msg", V: b},
{K: "msg", V: byteutil.B2S(b)},
}, "")
}
return len(b), nil