Use everywhere InterfaceMarshalFunc (#414)
This commit is contained in:
parent
b30730fab2
commit
dbdec88d16
|
@ -222,7 +222,7 @@ func (w ConsoleWriter) writeFields(evt map[string]interface{}, buf *bytes.Buffer
|
||||||
case json.Number:
|
case json.Number:
|
||||||
buf.WriteString(fv(fValue))
|
buf.WriteString(fv(fValue))
|
||||||
default:
|
default:
|
||||||
b, err := json.Marshal(fValue)
|
b, err := InterfaceMarshalFunc(fValue)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
fmt.Fprintf(buf, colorize("[error: %v]", colorRed, w.NoColor), err)
|
fmt.Fprintf(buf, colorize("[error: %v]", colorRed, w.NoColor), err)
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -102,7 +102,7 @@ func (w journalWriter) Write(p []byte) (n int, err error) {
|
||||||
case json.Number:
|
case json.Number:
|
||||||
args[jKey] = fmt.Sprint(value)
|
args[jKey] = fmt.Sprint(value)
|
||||||
default:
|
default:
|
||||||
b, err := json.Marshal(value)
|
b, err := zerolog.InterfaceMarshalFunc(value)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
args[jKey] = fmt.Sprintf("[error: %v]", err)
|
args[jKey] = fmt.Sprintf("[error: %v]", err)
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Reference in New Issue