chore(web): use logger directly
(cherry picked from commit 6fb314b326d530322f1a2e674f250a265268082c)
This commit is contained in:
@ -23,6 +23,7 @@ import (
|
||||
"strconv"
|
||||
|
||||
"code.vikunja.io/api/pkg/db"
|
||||
"code.vikunja.io/api/pkg/log"
|
||||
"code.vikunja.io/api/pkg/modules/auth"
|
||||
|
||||
"github.com/labstack/echo/v4"
|
||||
@ -35,7 +36,7 @@ func (c *WebHandler) ReadOneWeb(ctx echo.Context) error {
|
||||
|
||||
// Get the object & bind params to struct
|
||||
if err := ctx.Bind(currentStruct); err != nil {
|
||||
config.LoggingProvider.Debugf("Invalid model error. Internal error was: %s", err.Error())
|
||||
log.Debugf("Invalid model error. Internal error was: %s", err.Error())
|
||||
var he *echo.HTTPError
|
||||
if errors.As(err, &he) {
|
||||
return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid model provided. Error was: %s", he.Message))
|
||||
@ -54,7 +55,7 @@ func (c *WebHandler) ReadOneWeb(ctx echo.Context) error {
|
||||
defer func() {
|
||||
err = s.Close()
|
||||
if err != nil {
|
||||
config.LoggingProvider.Errorf("Could not close session: %s", err)
|
||||
log.Errorf("Could not close session: %s", err)
|
||||
}
|
||||
}()
|
||||
|
||||
@ -65,7 +66,7 @@ func (c *WebHandler) ReadOneWeb(ctx echo.Context) error {
|
||||
}
|
||||
if !canRead {
|
||||
_ = s.Rollback()
|
||||
config.LoggingProvider.Noticef("Tried to read while not having the rights for it (User: %v)", currentAuth)
|
||||
log.Warningf("Tried to read while not having the rights for it (User: %v)", currentAuth)
|
||||
return echo.NewHTTPError(http.StatusForbidden, "You don't have the right to see this")
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user