GetCtx retrieves the Go context.Context which is optionally stored in the Event. This allows Hooks and functions passed to Func() to retrieve values which are stored in the context.Context. This can be useful in tracing, where span information is commonly propagated in the context.Context.
()
| 508 | // which are stored in the context.Context. This can be useful in tracing, |
| 509 | // where span information is commonly propagated in the context.Context. |
| 510 | func (e *Event) GetCtx() context.Context { |
| 511 | if e == nil || e.ctx == nil { |
| 512 | return context.Background() |
| 513 | } |
| 514 | return e.ctx |
| 515 | } |
| 516 | |
| 517 | // Bool adds the field key with val as a bool to the *Event context. |
| 518 | func (e *Event) Bool(key string, b bool) *Event { |
no outgoing calls