logging

package
v1.2.22-bd314a9 Latest Latest
Warning

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

Go to latest
Published: Jan 24, 2023 License: MIT Imports: 25 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AccessLogOptionRequestBody added in v1.1.0

func AccessLogOptionRequestBody(c *gin.Context, fields logrus.Fields)

func GetElasticHook added in v1.1.3

func GetElasticHook(app, url, accessKey, secretKey string) (logrus.Hook, error)

func GetJSONFileHook added in v1.1.3

func GetJSONFileHook(dir, file string) (logrus.Hook, error)

absolute filename /home/bob/work/app.log

Types

type FileLogConfig added in v1.0.17

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

func (*FileLogConfig) GetHook added in v1.1.3

func (flc *FileLogConfig) GetHook() (logrus.Hook, error)

func (*FileLogConfig) MustGetHook added in v1.2.16

func (flc *FileLogConfig) MustGetHook() logrus.Hook

type IDotpeLogger added in v1.2.14

type IDotpeLogger interface {
	ILogWriter
	Gin() gin.HandlerFunc
}

ILogger ...

func MustGet added in v1.2.15

func MustGet(opts ...Option) IDotpeLogger

InitLogger sets up the logger object with LoggerOptions provided. It returns reference logger object and error

type IHookContainer added in v1.1.3

type IHookContainer interface {
	GetHook() (logrus.Hook, error)
	MustGetHook() logrus.Hook
}

func NewElasticHookContainer added in v1.1.3

func NewElasticHookContainer(Client, AccessKey, SecretKey, APP, APPID string) IHookContainer

func NewFileHookContainer added in v1.1.3

func NewFileHookContainer(app string) IHookContainer

type ILogWriter added in v1.2.14

type ILogWriter interface {
	WriteLogs(context.Context, logrus.Fields, logrus.Level, string)
}

func DefaultLogWriter added in v1.2.15

func DefaultLogWriter() ILogWriter

func LogWriter added in v1.2.15

func LogWriter() ILogWriter

type Option added in v1.1.0

type Option func(dlogger *dlogger)

func WithAccessLogOptions added in v1.1.0

func WithAccessLogOptions(opts ...accessLogOption) Option

func WithAppInfo added in v1.1.0

func WithAppInfo(app string) Option

func WithHook added in v1.1.0

func WithHook(hook logrus.Hook) Option

func WithHookContainer added in v1.1.0

func WithHookContainer(hookContainer IHookContainer) Option

func WithLogOptions added in v1.1.0

func WithLogOptions(opts ...logOption) Option

Jump to

Keyboard shortcuts

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