From ded6886de0ed10bfcd673a74cacfed0ca51fd690 Mon Sep 17 00:00:00 2001 From: konrad Date: Fri, 30 Nov 2018 22:16:34 +0100 Subject: [PATCH] Moved logging to extra parameter --- pkg/routes/crud/delete.go | 4 ++-- pkg/routes/crud/update.go | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/pkg/routes/crud/delete.go b/pkg/routes/crud/delete.go index 0819de558..b88ebe872 100644 --- a/pkg/routes/crud/delete.go +++ b/pkg/routes/crud/delete.go @@ -17,9 +17,9 @@ package crud import ( - "code.vikunja.io/api/pkg/log" "code.vikunja.io/api/pkg/web" "github.com/labstack/echo" + "github.com/op/go-logging" "net/http" ) @@ -45,7 +45,7 @@ func (c *WebHandler) DeleteWeb(ctx echo.Context) error { return echo.NewHTTPError(http.StatusInternalServerError) } if !currentStruct.CanDelete(currentAuth) { - log.Log.Noticef("Tried to delete while not having the rights for it", currentAuth) + ctx.Get("LoggingProvider").(*logging.Logger).Noticef("Tried to delete while not having the rights for it", currentAuth) return echo.NewHTTPError(http.StatusForbidden) } diff --git a/pkg/routes/crud/update.go b/pkg/routes/crud/update.go index b5c8fb6d7..8ccf93e2d 100644 --- a/pkg/routes/crud/update.go +++ b/pkg/routes/crud/update.go @@ -17,9 +17,9 @@ package crud import ( - "code.vikunja.io/api/pkg/log" "code.vikunja.io/api/pkg/web" "github.com/labstack/echo" + "github.com/op/go-logging" "net/http" ) @@ -46,7 +46,7 @@ func (c *WebHandler) UpdateWeb(ctx echo.Context) error { return echo.NewHTTPError(http.StatusInternalServerError, "Could not determine the current user.") } if !currentStruct.CanUpdate(currentAuth) { - log.Log.Noticef("Tried to update while not having the rights for it", currentAuth) + ctx.Get("LoggingProvider").(*logging.Logger).Noticef("Tried to update while not having the rights for it", currentAuth) return echo.NewHTTPError(http.StatusForbidden) }