(keyvals ...interface{})
| 106 | } |
| 107 | |
| 108 | func (s spanLogger) Log(keyvals ...interface{}) error { |
| 109 | for k := range s.kvs { |
| 110 | if f, ok := s.kvs[k].(log.Valuer); ok { |
| 111 | s.kvs[k] = f() |
| 112 | } |
| 113 | } |
| 114 | s.kvs = append(s.kvs, keyvals...) |
| 115 | s.span.LogKV(s.kvs...) |
| 116 | return s.base.Log(keyvals...) |
| 117 | } |
| 118 | |
| 119 | // WithContext decorates the log.Logger with information form context. If there is an opentracing span |
| 120 | // in the context, the span will receive the logger output as well. |