12345678910111213141516171819 |
- package fslog
- import (
- ginzap "github.com/gin-contrib/zap"
- "github.com/gin-gonic/gin"
- "time"
- )
- func GinLogger(skipPaths []string) gin.HandlerFunc {
- return ginzap.GinzapWithConfig(log.logger.Desugar(), &ginzap.Config{
- TimeFormat: time.RFC3339,
- UTC: true,
- SkipPaths: skipPaths,
- })
- }
- func GinRecovery() gin.HandlerFunc {
- return ginzap.RecoveryWithZap(log.logger.Desugar(), true)
- }
|