mirror of
https://github.com/pushbits/server.git
synced 2025-05-09 23:17:00 +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,12 +1,12 @@
|
|||
package api
|
||||
|
||||
import (
|
||||
"log"
|
||||
"net/http"
|
||||
"net/url"
|
||||
"time"
|
||||
|
||||
"github.com/pushbits/server/internal/authentication"
|
||||
"github.com/pushbits/server/internal/log"
|
||||
"github.com/pushbits/server/internal/model"
|
||||
|
||||
"github.com/gin-gonic/gin"
|
||||
|
@ -45,7 +45,7 @@ type NotificationHandler struct {
|
|||
// @Router /message [post]
|
||||
func (h *NotificationHandler) CreateNotification(ctx *gin.Context) {
|
||||
application := authentication.GetApplication(ctx)
|
||||
log.Printf("Sending notification for application %s.", application.Name)
|
||||
log.L.Printf("Sending notification for application %s.", application.Name)
|
||||
|
||||
var notification model.Notification
|
||||
if err := ctx.Bind(¬ification); err != nil {
|
||||
|
@ -79,7 +79,7 @@ func (h *NotificationHandler) CreateNotification(ctx *gin.Context) {
|
|||
// @Router /message/{message_id} [DELETE]
|
||||
func (h *NotificationHandler) DeleteNotification(ctx *gin.Context) {
|
||||
application := authentication.GetApplication(ctx)
|
||||
log.Printf("Deleting notification for application %s.", application.Name)
|
||||
log.L.Printf("Deleting notification for application %s.", application.Name)
|
||||
|
||||
id, err := getMessageID(ctx)
|
||||
if success := successOrAbort(ctx, http.StatusUnprocessableEntity, err); !success {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue