Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type SpanLogger ¶
type SpanLogger struct { log.Logger opentracing.Span }
SpanLogger unifies tracing and logging, to reduce repetition.
func FromContext ¶ added in v0.7.0
func FromContext(ctx context.Context) *SpanLogger
FromContext returns a span logger using the current parent span. If there is no parent span, the Spanlogger will only log to stdout.
func (*SpanLogger) Error ¶
func (s *SpanLogger) Error(err error) error
Error sets error flag and logs the error, if non-nil. Returns the err passed in.
func (*SpanLogger) Log ¶
func (s *SpanLogger) Log(kvps ...interface{}) error
Log implements gokit's Logger interface; sends logs to underlying logger and also puts the on the spans.
Click to show internal directories.
Click to hide internal directories.