logger: serialize unknown fields to json
Signed-off-by: Andrea Luzzardi <aluzzardi@gmail.com>
This commit is contained in:
parent
6cecde59fd
commit
5cd3aa5001
@ -163,6 +163,12 @@ func (c *Console) formatFields(entry map[string]interface{}) string {
|
|||||||
fields = append(fields, fmt.Sprintf("%s=%s", key, s))
|
fields = append(fields, fmt.Sprintf("%s=%s", key, s))
|
||||||
case nil:
|
case nil:
|
||||||
fields = append(fields, fmt.Sprintf("%s=null", key))
|
fields = append(fields, fmt.Sprintf("%s=null", key))
|
||||||
|
default:
|
||||||
|
o, err := json.MarshalIndent(v, "", " ")
|
||||||
|
if err != nil {
|
||||||
|
panic(err)
|
||||||
|
}
|
||||||
|
fields = append(fields, fmt.Sprintf("%s=%s", key, o))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user