tracelog

package
v0.18.0 Latest Latest
Warning

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

Go to latest
Published: Jun 8, 2023 License: MIT Imports: 7 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func TraceID added in v0.13.0

func TraceID(ctx context.Context) string

Types

type Logger

type Logger interface {
	TraceID(ctx context.Context) string
	Debug(ctx context.Context, args ...interface{})
	Debugf(ctx context.Context, template string, args ...interface{})
	Info(ctx context.Context, args ...interface{})
	Infof(ctx context.Context, template string, args ...interface{})
	Warn(ctx context.Context, args ...interface{})
	Warnf(ctx context.Context, template string, args ...interface{})
	Error(ctx context.Context, args ...interface{})
	Errorf(ctx context.Context, template string, args ...interface{})
	With(args ...interface{}) Logger
	WithJSON(key string, b []byte) Logger
}

type TraceLogger

type TraceLogger struct {
	*zap.SugaredLogger
}

func NewTraceLogger

func NewTraceLogger(logger *zap.SugaredLogger) *TraceLogger

func (*TraceLogger) Debug

func (l *TraceLogger) Debug(ctx context.Context, args ...interface{})

func (*TraceLogger) Debugf

func (l *TraceLogger) Debugf(ctx context.Context, template string, args ...interface{})

func (*TraceLogger) Error

func (l *TraceLogger) Error(ctx context.Context, args ...interface{})

func (*TraceLogger) Errorf

func (l *TraceLogger) Errorf(ctx context.Context, template string, args ...interface{})

func (*TraceLogger) Info

func (l *TraceLogger) Info(ctx context.Context, args ...interface{})

func (*TraceLogger) Infof

func (l *TraceLogger) Infof(ctx context.Context, template string, args ...interface{})

func (*TraceLogger) TraceID

func (l *TraceLogger) TraceID(ctx context.Context) string

func (*TraceLogger) Warn

func (l *TraceLogger) Warn(ctx context.Context, args ...interface{})

func (*TraceLogger) Warnf

func (l *TraceLogger) Warnf(ctx context.Context, template string, args ...interface{})

func (TraceLogger) With

func (l TraceLogger) With(args ...interface{}) Logger

func (*TraceLogger) WithJSON

func (l *TraceLogger) WithJSON(key string, b []byte) Logger

Jump to

Keyboard shortcuts

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