change to use logging instead of print to stdout

This commit is contained in:
2023-04-03 12:00:01 +10:00
parent f2ac6097d6
commit 5cc67501d3
11 changed files with 88 additions and 87 deletions

View File

@@ -3,7 +3,7 @@ package controllers
import (
"ccsecrets/models"
"ccsecrets/utils/token"
"fmt"
"log"
"net/http"
"github.com/gin-gonic/gin"
@@ -22,7 +22,7 @@ func RetrieveSecret(c *gin.Context) {
c.JSON(http.StatusBadRequest, gin.H{"error": err.Error()})
return
}
fmt.Printf("RetrieveSecret received JSON input '%v'\n", input)
log.Printf("RetrieveSecret received JSON input '%v'\n", input)
// Get the user and role id of the requestor
user_id, err := token.ExtractTokenID(c)
@@ -72,7 +72,7 @@ func RetrieveMultpleSecrets(c *gin.Context) {
c.JSON(http.StatusBadRequest, gin.H{"error": err.Error()})
return
}
fmt.Printf("StoreSecret received JSON input '%v'\n", input)
log.Printf("StoreSecret received JSON input '%v'\n", input)
// Get the user and role id of the requestor
user_id, err := token.ExtractTokenID(c)