Array adds the field key with an array to the event context. Use c.CreateArray() to create the array or pass a type that implement the LogArrayMarshaler interface.
(key string, arr LogArrayMarshaler)
| 58 | // Use c.CreateArray() to create the array or pass a type that |
| 59 | // implement the LogArrayMarshaler interface. |
| 60 | func (c Context) Array(key string, arr LogArrayMarshaler) Context { |
| 61 | c.l.context = enc.AppendKey(c.l.context, key) |
| 62 | if arr, ok := arr.(*Array); ok { |
| 63 | c.l.context = arr.write(c.l.context) |
| 64 | return c |
| 65 | } |
| 66 | a := c.CreateArray() |
| 67 | arr.MarshalZerologArray(a) |
| 68 | c.l.context = a.write(c.l.context) |
| 69 | return c |
| 70 | } |
| 71 | |
| 72 | // Object marshals an object that implement the LogObjectMarshaler interface. |
| 73 | func (c Context) Object(key string, obj LogObjectMarshaler) Context { |
no test coverage detected