log

package
v1.5.3 Latest Latest
Warning

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

Go to latest
Published: Dec 8, 2023 License: MIT Imports: 12 Imported by: 39

Documentation

Index

Constants

View Source
const (
	CtxLogKey = util.CtxKey("ctxLogKey")

	LogTargetOS = "os"
)
View Source
const LogTargetFluent = "fluent"

Variables

This section is empty.

Functions

This section is empty.

Types

type Logger

type Logger interface {
	Info(msg string)
	Debug(msg string)
	Warn(msg string)
	Err(msg string)
	Fatal(msg string)
}

func GetLogByCtx added in v1.0.0

func GetLogByCtx(ctx context.Context) Logger

func GetLogByGin added in v1.4.0

func GetLogByGin(c *gin.Context) Logger

func GetLogByReq added in v1.0.0

func GetLogByReq(req *http.Request) Logger

type LoggerConf

type LoggerConf struct {
	Level     string     `yaml:"-"`
	Target    string     `yaml:"-"`
	FluentLog *fluentLog `yaml:"fluent,omitempty"`
}

func (*LoggerConf) NewLogger

func (lc *LoggerConf) NewLogger(key string) Logger

type LoggerDI

type LoggerDI interface {
	NewLogger(key string) Logger
}

Jump to

Keyboard shortcuts

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