NewContext returns a derived context with the logger set.
(ctx context.Context, logger Interface)
| 22 | |
| 23 | // NewContext returns a derived context with the logger set. |
| 24 | func NewContext(ctx context.Context, logger Interface) context.Context { |
| 25 | return context.WithValue(ctx, loggerKey, logger) |
| 26 | } |
| 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 { |
no outgoing calls