With returns a context that contains the given fields. Any logs written with the provided context will have the given logs prepended. It will append to any fields already in ctx.
(ctx context.Context, fields ...Field)
| 263 | // |
| 264 | // It will append to any fields already in ctx. |
| 265 | func With(ctx context.Context, fields ...Field) context.Context { |
| 266 | f1 := fieldsFromContext(ctx) |
| 267 | f2 := f1.append(fields) |
| 268 | return fieldsWithContext(ctx, f2) |
| 269 | } |
| 270 | |
| 271 | // SinkEntry represents the structure of a log entry. |
| 272 | // It is the argument to the sink when logging. |
nothing calls this directly
no test coverage detected