zap

package
v2.23.0+incompatible Latest Latest
Warning

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

Go to latest
Published: Apr 22, 2020 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Context

func Context(sc jaeger.SpanContext) zapcore.Field

Context creates a zap.Field which marshals all information contained in a jaeger context

func NewLoggingTracer

func NewLoggingTracer(logger *zap.Logger, tracer opentracing.Tracer) opentracing.Tracer

NewLoggingTracer creates a new tracer that logs all span interactions

func Span

func Span(s opentracing.Span) zapcore.Field

Span creates a zap.Field that marshals all information contained in a jaeger span

func Trace

func Trace(ctx context.Context) zapcore.Field

Trace creates a field that extracts tracing information from a context and includes it under the "trace" key.

Because the opentracing APIs don't expose this information, the returned zap.Field is a no-op for contexts that don't contain a span or contain a non-Jaeger span. TODO: delegate to `spanContext`

Types

type Logger

type Logger struct {
	// contains filtered or unexported fields
}

Logger is an adapter from zap Logger to jaeger-lib Logger.

func NewLogger

func NewLogger(logger *zap.Logger) *Logger

NewLogger creates a new Logger.

func (*Logger) Debugf

func (l *Logger) Debugf(msg string, args ...interface{})

Debugf logs a message at debug priority. TODO: treat the last arg specially similar to Slf4J - cast to zap.Span/etc if type assertion succeeds

func (*Logger) Error

func (l *Logger) Error(msg string)

Error logs a message at error priority

func (*Logger) Infof

func (l *Logger) Infof(msg string, args ...interface{})

Infof logs a message at info priority

Directories

Path Synopsis
Package mock_opentracing is a generated GoMock package.
Package mock_opentracing is a generated GoMock package.

Jump to

Keyboard shortcuts

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