gin_logger.go 308 B

1234567891011121314151617
  1. package fslog
  2. import (
  3. ginzap "github.com/gin-contrib/zap"
  4. "github.com/gin-gonic/gin"
  5. "time"
  6. )
  7. func GinLogger() gin.HandlerFunc {
  8. lazyInitialize()
  9. return ginzap.Ginzap(logger, time.RFC3339, true)
  10. }
  11. func GinRecovery() gin.HandlerFunc {
  12. lazyInitialize()
  13. return ginzap.RecoveryWithZap(logger, true)
  14. }