loggers

package
v1.3.1 Latest Latest
Warning

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

Go to latest
Published: Jul 11, 2023 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	//DEFAULT_LOG_LEVEL Default log level
	DEFAULT_LOG_LEVEL = "error"
	//DEFAULT_LOG_FILENAME Default log filename
	DEFAULT_LOG_FILENAME = "./log/ca.log"
	//DEFAULT_LOG_MAXSIZE Default log maxsize
	DEFAULT_LOG_MAXSIZE = 10
	//DEFAULT_LOG_MAXAGE Default log maxage
	DEFAULT_LOG_MAXAGE = 30
	//DEFAULT_LOG_MAXBACKUPS Default log maxbackups
	DEFAULT_LOG_MAXBACKUPS = 5
)

Variables

This section is empty.

Functions

func GetLogger

func GetLogger() *zap.Logger

GetLogger Get normal logger

func GetSugaLogger

func GetSugaLogger() *zap.SugaredLogger

GetSugaLogger Get sugared logger

func GinLogger

func GinLogger() gin.HandlerFunc

Receive the GIN framework's default log

func GinRecovery

func GinRecovery(stack bool) gin.HandlerFunc

GinRecovery recover panic

func InitLogger

func InitLogger(logConf *LogConifg) error

InitLogger init zap logger

Types

type LogConifg

type LogConifg struct {
	Level      string
	FileName   string
	MaxSize    int
	MaxAge     int
	MaxBackups int
}

LogConifg logger Config

Jump to

Keyboard shortcuts

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