WithContext adds a context to the Entry.
(ctx context.Context)
| 112 | |
| 113 | // WithContext adds a context to the Entry. |
| 114 | func (entry *Entry) WithContext(ctx context.Context) *Entry { |
| 115 | dataCopy := make(Fields, len(entry.Data)) |
| 116 | for k, v := range entry.Data { |
| 117 | dataCopy[k] = v |
| 118 | } |
| 119 | return &Entry{Logger: entry.Logger, Data: dataCopy, Time: entry.Time, err: entry.err, Context: ctx} |
| 120 | } |
| 121 | |
| 122 | // WithField adds a single field to the Entry. |
| 123 | func (entry *Entry) WithField(key string, value interface{}) *Entry { |
no outgoing calls