NewContextWithField returns a derived context with the given field added to the logger.
(ctx context.Context, k string, v any)
| 27 | |
| 28 | // NewContextWithField returns a derived context with the given field added to the logger. |
| 29 | func NewContextWithField(ctx context.Context, k string, v any) context.Context { |
| 30 | return NewContext(ctx, FromContext(ctx).WithField(k, v)) |
| 31 | } |
| 32 | |
| 33 | // NewContextWithFields returns a derived context with the given fields added to the logger. |
| 34 | func NewContextWithFields(ctx context.Context, f Fielder) context.Context { |