Func allows an anonymous func to run only if the event is enabled.
(f func(e *Event))
| 293 | |
| 294 | // Func allows an anonymous func to run only if the event is enabled. |
| 295 | func (e *Event) Func(f func(e *Event)) *Event { |
| 296 | if e != nil && e.Enabled() { |
| 297 | f(e) |
| 298 | } |
| 299 | return e |
| 300 | } |
| 301 | |
| 302 | // EmbedObject marshals an object that implement the LogObjectMarshaler interface. |
| 303 | func (e *Event) EmbedObject(obj LogObjectMarshaler) *Event { |