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