logger

package
v0.0.0-...-5117fa9 Latest Latest
Warning

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

Go to latest
Published: Nov 19, 2018 License: MIT Imports: 7 Imported by: 3

Documentation

Index

Constants

View Source
const (
	// opentracing log key is trace.traceid
	ContextHeaderName = "qeelyn-traceid"
	TraceIdKey        = "traceid"
)

Variables

This section is empty.

Functions

func NewFileLogger

func NewFileLogger(config map[string]interface{}) zapcore.Core

func NewStdLogger

func NewStdLogger() zapcore.Core

func TraceIdField

func TraceIdField(ctx context.Context) zap.Field

get trace id of zap field type

Types

type Logger

type Logger struct {
	ToZapField func(values []interface{}) []zapcore.Field
	// contains filtered or unexported fields
}

func NewLogger

func NewLogger(cores ...zapcore.Core) *Logger

func (*Logger) Print

func (l *Logger) Print(values ...interface{})

Print passes arguments to Println

func (*Logger) Println

func (l *Logger) Println(values []interface{})

for gorm & zap

func (*Logger) SetZap

func (l *Logger) SetZap(zap *zap.Logger)

func (*Logger) Strict

func (l *Logger) Strict() *zap.Logger

类型化日志

func (*Logger) Sugared

func (l *Logger) Sugared() *zap.SugaredLogger

语法糖方式,记录简单信息

func (*Logger) WithContext

func (l *Logger) WithContext(ctx context.Context) *zap.Logger

Jump to

Keyboard shortcuts

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