tracing

package
v1.0.0-alpha.6 Latest Latest
Warning

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

Go to latest
Published: Jan 12, 2022 License: Apache-2.0 Imports: 10 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConvertAttributeToField

func ConvertAttributeToField(attr attribute.KeyValue) zapcore.Field

func ConvertAttributesToFields

func ConvertAttributesToFields(attrs []attribute.KeyValue) []zap.Field

Types

type RootLogger

type RootLogger interface {
	StartSpan(ctx context.Context, op string, attrs ...attribute.KeyValue) (context.Context, ScopedLogger)
	Debug(span trace.Span, msg string, attrs ...attribute.KeyValue)
	Debugf(span trace.Span, format string, args ...interface{})
	Info(span trace.Span, msg string, attrs ...attribute.KeyValue)
	Infof(span trace.Span, format string, args ...interface{})
	Warn(span trace.Span, msg string, attrs ...attribute.KeyValue)
	Warnf(span trace.Span, format string, args ...interface{})
	Error(span trace.Span, err error, attrs ...attribute.KeyValue) error
	Errorf(span trace.Span, msg string, args ...interface{}) error
}

func NewLogger

func NewLogger(logger *zap.Logger, tracer trace.Tracer, attrs ...attribute.KeyValue) RootLogger

type ScopedLogger

type ScopedLogger interface {
	StartSpan(op string, attrs ...attribute.KeyValue) (context.Context, ScopedLogger)
	EndSpan(opts ...trace.SpanEndOption)
	Debug(msg string, attrs ...attribute.KeyValue)
	Debugf(format string, args ...interface{})
	Info(msg string, attrs ...attribute.KeyValue)
	Infof(format string, args ...interface{})
	Warn(msg string, attrs ...attribute.KeyValue)
	Warnf(format string, args ...interface{})
	Error(err error, attrs ...attribute.KeyValue) error
	Errorf(msg string, args ...interface{}) error
}

func LoggerFromContext

func LoggerFromContext(ctx context.Context) ScopedLogger

func NewScopedLogger

func NewScopedLogger(ctx context.Context, span trace.Span, logger RootLogger) (context.Context, ScopedLogger)

Jump to

Keyboard shortcuts

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