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,15 +1,15 @@
package routes
import (
"log"
"strings"
"git.matterlinux.xyz/matter/security/lib"
"git.matterlinux.xyz/matter/security/log"
"github.com/gofiber/fiber/v2"
_ "github.com/mattn/go-sqlite3"
)
func POSTStatus(c *fiber.Ctx) error {
func POST_Status(c *fiber.Ctx) error {
body := struct {
ID string `form:"id"`
Status string `form:"status"`
@ -23,7 +23,7 @@ func POSTStatus(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)
}
@ -40,7 +40,7 @@ func POSTStatus(c *fiber.Ctx) error {
err = lib.UpdateVuln(vuln)
if err != nil {
log.Printf("Failed to update the vuln: %s", err.Error())
log.Error("Failed to update the vuln: %s", err.Error())
return lib.RenderError(c, 500)
}