NewContextWithFields returns a derived context with the given fields added to the logger.
(ctx context.Context, f Fielder)
| 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 { |
| 35 | return NewContext(ctx, FromContext(ctx).WithFields(f)) |
| 36 | } |
| 37 | |
| 38 | // FromContext returns the logger that is attached to the context or returns the Noop logger if it does not exist |
| 39 | func FromContext(ctx context.Context) Interface { |