update: new logging functions
This commit is contained in:
@ -1,13 +1,12 @@
|
||||
package routes
|
||||
|
||||
import (
|
||||
"log"
|
||||
|
||||
"git.matterlinux.xyz/matter/security/lib"
|
||||
"git.matterlinux.xyz/matter/security/log"
|
||||
"github.com/gofiber/fiber/v2"
|
||||
)
|
||||
|
||||
func POSTNew(c *fiber.Ctx) error {
|
||||
func POST_New(c *fiber.Ctx) error {
|
||||
body := struct {
|
||||
Desc string `form:"desc"`
|
||||
Source string `form:"source"`
|
||||
@ -23,7 +22,7 @@ func POSTNew(c *fiber.Ctx) error {
|
||||
|
||||
user, err := lib.GetUser(c)
|
||||
if err != nil {
|
||||
log.Printf("Failed to get the user: %s", err.Error())
|
||||
log.Error("Failed to get the user: %s", err.Error())
|
||||
return lib.RenderError(c, 500)
|
||||
}
|
||||
|
||||
@ -47,7 +46,7 @@ func POSTNew(c *fiber.Ctx) error {
|
||||
|
||||
err = lib.AddVuln(v)
|
||||
if err != nil {
|
||||
log.Printf("Failed to add vuln: %s", err.Error())
|
||||
log.Error("Failed to add vuln: %s", err.Error())
|
||||
return lib.RenderError(c, 500)
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user