Help us shape the future of Go! Take the 2026 Go Developer Survey

spanlogger

package
v0.6.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 5, 2020 License: Apache-2.0 Imports: 7 Imported by: 52

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 New

func New(ctx context.Context, method string, kvps ...interface{}) (*SpanLogger, context.Context)

New makes a new SpanLogger.

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL