Stringer adds the field key and a val to the *Event context. If val is not nil, it is added by calling val.String(). If val is nil, it is encoded as null without calling String().
(key string, val fmt.Stringer)
| 342 | // If val is not nil, it is added by calling val.String(). |
| 343 | // If val is nil, it is encoded as null without calling String(). |
| 344 | func (e *Event) Stringer(key string, val fmt.Stringer) *Event { |
| 345 | if e == nil { |
| 346 | return e |
| 347 | } |
| 348 | e.buf = enc.AppendStringer(enc.AppendKey(e.buf, key), val) |
| 349 | return e |
| 350 | } |
| 351 | |
| 352 | // Stringers adds the field key with vals to the *Event context. |
| 353 | // If a val is not nil, it is added by calling val.String(). |