CreateDict creates an Event to be used with the *Event.Dict method. It preserves the stack, hooks, and context from the parent event. Call usual field methods like Str, Int etc to add fields to this event and give it as argument the *Event.Dict method.
()
| 193 | // Call usual field methods like Str, Int etc to add fields to this |
| 194 | // event and give it as argument the *Event.Dict method. |
| 195 | func (e *Event) CreateDict() *Event { |
| 196 | if e == nil { |
| 197 | return newEvent(nil, DebugLevel, false, nil, nil) |
| 198 | } |
| 199 | return newEvent(nil, DebugLevel, e.stack, e.ctx, e.ch) |
| 200 | } |
| 201 | |
| 202 | // Dict creates an Event to be used with the *Event.Dict method. |
| 203 | // Call usual field methods like Str, Int etc to add fields to this |