log

package
v0.0.0-...-47b8e0f Latest Latest
Warning

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

Go to latest
Published: Jul 16, 2023 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const LogIDKey = "log_id"

Variables

This section is empty.

Functions

func Ctx

func Ctx(ctx context.Context) *logrus.Entry

func GenLogID

func GenLogID() string

func GetCtxWithLogID

func GetCtxWithLogID(ctx context.Context) context.Context

func GetDefaultOutput

func GetDefaultOutput() io.Writer

func Init

func Init() error

Types

type MyLogWriter

type MyLogWriter struct {
	Logger *lumberjack.Logger
	// ToStd 同时写入到标准输出和文件
	ToStd bool
}

func (*MyLogWriter) Close

func (l *MyLogWriter) Close() error

func (*MyLogWriter) Write

func (l *MyLogWriter) Write(p []byte) (n int, err error)

Jump to

Keyboard shortcuts

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