Closed stefanvanburen closed 6 years ago
I'd prefer to keep the json one purely "structured" so you can query against those as numerical values, though I'll admit nanosecond resolution is a bit overkill haha
Cool, makes sense. Thanks for the library! 😄
Currently the duration field in
log.Stop
is set to be atime.Duration
type, which is then formatted by the handlers. see here: https://github.com/apex/log/blob/a0bcece0a725e2b62f01d948b25ba3c22ebfb792/entry.go#L144-L146With the JSON handler, this ends up looking like this:
"duration":1935807,
Calling
.String()
on the duration ends up with a more human-readable:"duration":"1.935807ms"
I realize that the JSON handler is meant to be machine-parseable, but think the second is still machine-parseable while being much more human-readable.
Any thoughts? Would be glad to submit a PR with this change.