log

package module
v1.0.5 Latest Latest
Warning

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

Go to latest
Published: Mar 8, 2024 License: MIT Imports: 14 Imported by: 11

README

log

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func EnvHasFluentd added in v1.0.2

func EnvHasFluentd() bool

func SetByCtx

func SetByCtx(ctx context.Context, l Logger) context.Context

func SetByGinCtx

func SetByGinCtx(c *gin.Context, l Logger)

func SetByReq

func SetByReq(req *http.Request, l Logger) *http.Request

Types

type Logger

type Logger interface {
	Info(string)
	Infof(format string, a ...any)
	Debug(string)
	Debugf(format string, a ...any)
	Warn(string)
	Warnf(format string, a ...any)
	WarnPkg(error)
	Error(string)
	Errorf(format string, a ...any)
	ErrorPkg(error)
	Fatal(string)
	Fatalf(format string, a ...any)
	FatalPkg(error)
	GetLogging() *log.Logger
}

func GetByCtx

func GetByCtx(ctx context.Context) Logger

func GetByGinCtx

func GetByGinCtx(c *gin.Context) Logger

func GetByReq

func GetByReq(req *http.Request) Logger

type LoggerConf

type LoggerConf struct {
	FluentLog *fluentLog `yaml:"fluentd,omitempty"`
}

func NewLogerConfWithFluentd

func NewLogerConfWithFluentd(host string, port int) *LoggerConf

func (*LoggerConf) NewLogger

func (lc *LoggerConf) NewLogger(service, pid string) (Logger, error)

type LoggerDI

type LoggerDI interface {
	NewLogger(service string, pid string) (Logger, error)
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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