Interface adds the field key with i marshaled using reflection.
(key string, i interface{})
| 823 | |
| 824 | // Interface adds the field key with i marshaled using reflection. |
| 825 | func (e *Event) Interface(key string, i interface{}) *Event { |
| 826 | if e == nil { |
| 827 | return e |
| 828 | } |
| 829 | if obj, ok := i.(LogObjectMarshaler); ok { |
| 830 | return e.Object(key, obj) |
| 831 | } |
| 832 | e.buf = enc.AppendInterface(enc.AppendKey(e.buf, key), i) |
| 833 | return e |
| 834 | } |
| 835 | |
| 836 | // Type adds the field key with val's type using reflection. |
| 837 | func (e *Event) Type(key string, val interface{}) *Event { |