Merge pull request #197 from dagger/logger-json
logger: serialize unknown fields to json
This commit is contained in:
commit
1309af9c9c
@ -163,6 +163,12 @@ func (c *Console) formatFields(entry map[string]interface{}) string {
|
||||
fields = append(fields, fmt.Sprintf("%s=%s", key, s))
|
||||
case nil:
|
||||
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