phuslu / log

Fastest structured logging
MIT License
672 stars 44 forks source link

Msg() truncate strings with single quotes when having a custom Formatter #30

Closed silisium closed 3 years ago

silisium commented 3 years ago

given a simple Formatter like this :

Formatter: func (w io.Writer, a *log.FormatterArgs) (int, error) {
            return fmt.Fprintf(w, "%s", a.Message)

this :

log.Info().Msg("aaaa 'b' cccc")

will output :

aaaa '
phuslu commented 3 years ago

thanks for reporting. seems there's a bug in formatter.go json parser

phuslu commented 3 years ago

should fixed in https://github.com/phuslu/log/releases/tag/v1.0.68

silisium commented 3 years ago

fix confirmed, thanks for the quick fix, and for this great module