logger

package
v0.0.0-...-ba78406 Latest Latest
Warning

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

Go to latest
Published: Nov 19, 2022 License: MIT Imports: 8 Imported by: 0

README

logger

BenchmarkLogger-12        275109              4091 ns/op             288 B/op          3 allocs/op
BenchmarkZap-12           292981              3937 ns/op             240 B/op          2 allocs/op
PASS
ok      github.com/syunkitada/goapp2/pkg/lib    2.379s

Documentation

Index

Constants

View Source
const (
	LevelDebug = "Debug"
	LevelInfo  = "Info"
	LevelWarn  = "Warn"
)

Variables

This section is empty.

Functions

func Debug

func Debug(tctx *TraceContext, msg string, fields ...zap.Field)

func Debugf

func Debugf(tctx *TraceContext, msg string, fields ...interface{})

func Error

func Error(tctx *TraceContext, msg string, fields ...zap.Field)

func Errorf

func Errorf(tctx *TraceContext, msg string, fields ...interface{})

func Fatal

func Fatal(tctx *TraceContext, msg string, fields ...zap.Field)

func Fatalf

func Fatalf(tctx *TraceContext, msg string, fields ...interface{})

func Info

func Info(tctx *TraceContext, msg string, fields ...zap.Field)

func Infof

func Infof(tctx *TraceContext, msg string, fields ...interface{})

func Init

func Init(conf2 *Config)

func NewZapCoreLevel

func NewZapCoreLevel(levelStr string) (level zapcore.Level)

func Sync

func Sync()

func Warn

func Warn(tctx *TraceContext, msg string, fields ...zap.Field)

func Warnf

func Warnf(tctx *TraceContext, msg string, fields ...interface{})

Types

type Config

type Config struct {
	OutputPaths []string
	Level       string
	Encoding    string
	DisableExit bool
}

type TraceContext

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

func NewTraceContext

func NewTraceContext() (tctx *TraceContext)

func (*TraceContext) GetTraceId

func (self *TraceContext) GetTraceId() (traceId string)

func (*TraceContext) MarshalLogObject

func (self *TraceContext) MarshalLogObject(enc zapcore.ObjectEncoder) (err error)

Jump to

Keyboard shortcuts

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