Objects adds the field key with objs as an array of objects that implement the LogObjectMarshaler interface to the event. This is the array version that accepts a slice of LogObjectMarshaler objects.
(key string, objs []LogObjectMarshaler)
| 269 | // |
| 270 | // This is the array version that accepts a slice of LogObjectMarshaler objects. |
| 271 | func (e *Event) Objects(key string, objs []LogObjectMarshaler) *Event { |
| 272 | if e == nil { |
| 273 | return e |
| 274 | } |
| 275 | e.buf = enc.AppendArrayStart(enc.AppendKey(e.buf, key)) |
| 276 | for i, obj := range objs { |
| 277 | e.buf = appendObject(e.buf, obj, e.stack, e.ctx, e.ch) |
| 278 | if i < (len(objs) - 1) { |
| 279 | e.buf = enc.AppendArrayDelim(e.buf) |
| 280 | } |
| 281 | } |
| 282 | e.buf = enc.AppendArrayEnd(e.buf) |
| 283 | return e |
| 284 | } |
| 285 | |
| 286 | // ObjectsV adds the field key with objs as an array of objects that |
| 287 | // implement the LogObjectMarshaler interface to the event. |