mirror of
https://github.com/superseriousbusiness/gotosocial.git
synced 2025-10-28 11:22:25 -05:00
[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:
parent
19784e381b
commit
4b6c65fc15
1 changed files with 2 additions and 1 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue