update: new logging functions

This commit is contained in:
ngn
2024-08-13 22:40:44 +03:00
parent 4641faefc2
commit 561f9a2340
13 changed files with 76 additions and 478 deletions

View File

@ -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)
}