Add Any field function (#515)
This commit is contained in:
parent
3543e9d94b
commit
164f7aa1a6
5
event.go
5
event.go
|
@ -707,6 +707,11 @@ func (e *Event) TimeDiff(key string, t time.Time, start time.Time) *Event {
|
||||||
return e
|
return e
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Any is a wrapper around Event.Interface.
|
||||||
|
func (e *Event) Any(key string, i interface{}) *Event {
|
||||||
|
return e.Interface(key, i)
|
||||||
|
}
|
||||||
|
|
||||||
// Interface adds the field key with i marshaled using reflection.
|
// Interface adds the field key with i marshaled using reflection.
|
||||||
func (e *Event) Interface(key string, i interface{}) *Event {
|
func (e *Event) Interface(key string, i interface{}) *Event {
|
||||||
if e == nil {
|
if e == nil {
|
||||||
|
|
Loading…
Reference in New Issue