Error sets error flag and logs the error on the span, if non-nil. Returns the err passed in.
(err error)
| 95 | |
| 96 | // Error sets error flag and logs the error on the span, if non-nil. Returns the err passed in. |
| 97 | func (s *SpanLogger) Error(err error) error { |
| 98 | if err == nil { |
| 99 | return nil |
| 100 | } |
| 101 | ext.Error.Set(s.Span, true) |
| 102 | s.LogFields(otlog.Error(err)) |
| 103 | return err |
| 104 | } |