mirror of
https://github.com/minoplhy/chibisafe-netproxy.git
synced 2024-11-22 03:27:08 +00:00
chibisafe_netstorage_middleman : Properly handle Logging
This commit is contained in:
parent
8aa71c95db
commit
014568ee02
@ -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)
|
||||||
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user