Documentation ¶ Index ¶ func GinLogger() gin.HandlerFunc func GinRecovery(stack bool) gin.HandlerFunc func InitLogger(cfg *LogConfig) (err error) type LogConfig Constants ¶ This section is empty. Variables ¶ This section is empty. Functions ¶ func GinLogger ¶ func GinLogger() gin.HandlerFunc GinLogger 接收gin框架默认的日志 func GinRecovery ¶ func GinRecovery(stack bool) gin.HandlerFunc GinRecovery recover掉项目可能出现的panic,并使用zap记录相关日志 func InitLogger ¶ func InitLogger(cfg *LogConfig) (err error) InitLogger 初始化Logger Types ¶ type LogConfig ¶ type LogConfig struct { Level string `json:"level"` Filename string `json:"filename"` MaxSize int `json:"maxsize"` MaxAge int `json:"max_age"` MaxBackups int `json:"max_backups"` } Source Files ¶ View all Source files gin_log.go Click to show internal directories. Click to hide internal directories.