Dict adds the field key with a dict to the event context. Use e.CreateDict() to create the dictionary.
(key string, dict *Event)
| 180 | // Dict adds the field key with a dict to the event context. |
| 181 | // Use e.CreateDict() to create the dictionary. |
| 182 | func (e *Event) Dict(key string, dict *Event) *Event { |
| 183 | if e != nil { |
| 184 | dict.buf = enc.AppendEndMarker(dict.buf) |
| 185 | e.buf = append(enc.AppendKey(e.buf, key), dict.buf...) |
| 186 | } |
| 187 | putEvent(dict) |
| 188 | return e |
| 189 | } |
| 190 | |
| 191 | // CreateDict creates an Event to be used with the *Event.Dict method. |
| 192 | // It preserves the stack, hooks, and context from the parent event. |