Documentation
¶
Index ¶
- func NewLoggerMiddleware(logger Logger) gin.HandlerFunc
- func NewRecoveryMiddleware(logger Logger) gin.HandlerFunc
- func NewZapLoggerAdapter(logger Logger) ginzap.ZapLogger
- func NewZapLoggerMiddleware(logger ginzap.ZapLogger) gin.HandlerFunc
- func NewZapRecoveryMiddleware(logger ginzap.ZapLogger) gin.HandlerFunc
- type Logger
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewLoggerMiddleware ¶
func NewLoggerMiddleware(logger Logger) gin.HandlerFunc
NewLoggerMiddleware creates a Gin logging middleware using the provided logger. It logs HTTP requests with RFC3339 timestamp format and UTC timezone.
func NewRecoveryMiddleware ¶
func NewRecoveryMiddleware(logger Logger) gin.HandlerFunc
NewRecoveryMiddleware creates a Gin recovery middleware that logs panics using the provided logger. It recovers from panics and logs them while keeping the HTTP stack intact.
func NewZapLoggerAdapter ¶
NewZapLoggerAdapter creates a ginzap.ZapLogger adapter from a generic Logger interface. This allows using any logger implementation with gin-contrib/zap middleware.
func NewZapLoggerMiddleware ¶
func NewZapLoggerMiddleware(logger ginzap.ZapLogger) gin.HandlerFunc
NewZapLoggerMiddleware creates a Gin logging middleware using a native ginzap.ZapLogger. This is useful when you already have a ginzap.ZapLogger implementation.
func NewZapRecoveryMiddleware ¶
func NewZapRecoveryMiddleware(logger ginzap.ZapLogger) gin.HandlerFunc