package zap

import "github.com/uber/jaeger-client-go/log/zap"

Index

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

Source Files

field.go logger.go tracer.go

Directories

PathSynopsis
log/zap/mock_opentracingPackage mock_opentracing is a generated GoMock package.
Version
v2.29.1+incompatible
Published
May 24, 2021
Platform
linux/amd64
Imports
7 packages
Last checked
2 hours ago

Tools for package owners.