Ctx adds the Go Context to the *Event context. The context is not rendered in the output message, but is available to hooks and to Func() calls via the GetCtx() accessor. A typical use case is to extract tracing information from the Go Ctx.
(ctx context.Context)
| 497 | // GetCtx() accessor. A typical use case is to extract tracing information from |
| 498 | // the Go Ctx. |
| 499 | func (e *Event) Ctx(ctx context.Context) *Event { |
| 500 | if e != nil { |
| 501 | e.ctx = ctx |
| 502 | } |
| 503 | return e |
| 504 | } |
| 505 | |
| 506 | // GetCtx retrieves the Go context.Context which is optionally stored in the |
| 507 | // Event. This allows Hooks and functions passed to Func() to retrieve values |
no outgoing calls