diff --git a/main.go b/main.go index af6b269..eca3f91 100644 --- a/main.go +++ b/main.go @@ -9,6 +9,7 @@ import ( "github.com/gofiber/fiber/v2" "github.com/gofiber/fiber/v2/middleware/cors" + flogger "github.com/gofiber/fiber/v2/middleware/logger" ) func init() { @@ -23,6 +24,12 @@ func main() { app.Use(cors.New()) + if config.Cfg.Debug { + app.Use(flogger.New(flogger.Config{ + Format: "${pid} ${locals:requestid} ${status} - ${latency} ${method} ${path}​\n", + })) + } + router.SetupRoutes(app) app.Listen(config.Cfg.Host + ":" + config.Cfg.Port)