mirror of
https://github.com/pushbits/server.git
synced 2025-06-03 19:22:05 +02:00
Use logrus for logging
This commit is contained in:
parent
c96baf40a5
commit
f839f248b9
19 changed files with 192 additions and 87 deletions
|
@ -1,21 +1,20 @@
|
|||
package router
|
||||
|
||||
import (
|
||||
"log"
|
||||
"github.com/gin-contrib/location"
|
||||
"github.com/gin-gonic/gin"
|
||||
|
||||
"github.com/pushbits/server/internal/api"
|
||||
"github.com/pushbits/server/internal/authentication"
|
||||
"github.com/pushbits/server/internal/authentication/credentials"
|
||||
"github.com/pushbits/server/internal/database"
|
||||
"github.com/pushbits/server/internal/dispatcher"
|
||||
|
||||
"github.com/gin-contrib/location"
|
||||
"github.com/gin-gonic/gin"
|
||||
"github.com/pushbits/server/internal/log"
|
||||
)
|
||||
|
||||
// Create a Gin engine and setup all routes.
|
||||
func Create(debug bool, cm *credentials.Manager, db *database.Database, dp *dispatcher.Dispatcher) *gin.Engine {
|
||||
log.Println("Setting up HTTP routes.")
|
||||
log.L.Println("Setting up HTTP routes.")
|
||||
|
||||
if !debug {
|
||||
gin.SetMode(gin.ReleaseMode)
|
||||
|
@ -28,7 +27,8 @@ func Create(debug bool, cm *credentials.Manager, db *database.Database, dp *disp
|
|||
notificationHandler := api.NotificationHandler{DB: db, DP: dp}
|
||||
userHandler := api.UserHandler{AH: &applicationHandler, CM: cm, DB: db, DP: dp}
|
||||
|
||||
r := gin.Default()
|
||||
r := gin.New()
|
||||
r.Use(log.GinLogger(log.L), gin.Recovery())
|
||||
|
||||
r.Use(location.Default())
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue