in internal/error.go [36:50]
func (err ecsError) MarshalLogObject(enc zapcore.ObjectEncoder) error {
enc.AddString("message", err.Error())
if e, ok := err.error.(stackTracer); ok {
enc.AddString("stack_trace", fmt.Sprintf("%+v", e.StackTrace()))
}
// TODO(simitt): support for improved error handling
// https://github.com/elastic/ecs-logging-go-zap/issues/8
if e, ok := err.error.(errorGroup); ok {
if errorCause := e.Errors(); len(errorCause) > 0 {
return enc.AddArray("cause", errArray(errorCause))
}
}
return nil
}