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: 10 modules, 39 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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