chibisafe_netstorage_middleman : Properly handle Logging

This commit is contained in:
minoplhy 2024-04-10 23:02:03 +07:00
parent 8aa71c95db
commit 014568ee02
Signed by: minoplhy
GPG Key ID: 41D406044E2434BF
2 changed files with 30 additions and 19 deletions

37
main.go

File diff suppressed because it is too large Load Diff

View File

@ -1,6 +1,10 @@
package handler package handler
import "encoding/json" import (
"encoding/json"
"log"
"strings"
)
func ErrorResponseBuild(StatusCode int64, Message string) string { func ErrorResponseBuild(StatusCode int64, Message string) string {
ErrorResponse := ErrorResponse{ ErrorResponse := ErrorResponse{
@ -10,3 +14,9 @@ func ErrorResponseBuild(StatusCode int64, Message string) string {
Response, _ := json.Marshal(ErrorResponse) Response, _ := json.Marshal(ErrorResponse)
return string(Response) return string(Response)
} }
func LogBuilder(Type string, headers []string, message string) {
logString := "[" + Type + "]" + " "
logString += "[" + strings.Join(headers, "] [") + "]" + " : " + message
log.Println(logString)
}