26 lines
615 B
Go
26 lines
615 B
Go
package handlers
|
|
|
|
import (
|
|
"time"
|
|
|
|
"github.com/gofiber/fiber/v2"
|
|
"go.uber.org/zap"
|
|
)
|
|
|
|
func (h *Handler) BadRequestLogger() *zap.Logger {
|
|
return h.mongoLoggerSvc.With(
|
|
zap.Int("status_code", fiber.StatusBadRequest),
|
|
zap.Time("timestamp", time.Now()))
|
|
}
|
|
func (h *Handler) InternalServerErrorLogger() *zap.Logger {
|
|
return h.mongoLoggerSvc.With(
|
|
zap.Int("status_code", fiber.StatusInternalServerError),
|
|
zap.Time("timestamp", time.Now()))
|
|
}
|
|
func (h *Handler) SuccessResLogger() *zap.Logger {
|
|
return h.mongoLoggerSvc.With(
|
|
zap.Int("status_code", fiber.StatusOK),
|
|
zap.Time("timestamp", time.Now()),
|
|
)
|
|
}
|