ContextMap returns a map for all fields in Context.
()
| 31 | |
| 32 | // ContextMap returns a map for all fields in Context. |
| 33 | func (e LoggedEntry) ContextMap() map[string]interface{} { |
| 34 | encoder := zapcore.NewMapObjectEncoder() |
| 35 | for _, f := range e.Context { |
| 36 | f.AddTo(encoder) |
| 37 | } |
| 38 | return encoder.Fields |
| 39 | } |