1
0
mirror of https://github.com/muety/wakapi.git synced 2023-08-10 21:12:56 +03:00

refactor: include logging framework (resolve #92)

This commit is contained in:
Ferdinand Mütsch
2021-01-30 11:17:37 +01:00
parent fd239e4f21
commit 617d9ad7e4
16 changed files with 80 additions and 77 deletions

View File

@ -2,7 +2,7 @@ package utils
import (
"encoding/json"
"log"
"github.com/emvi/logbuch"
"net/http"
)
@ -10,6 +10,6 @@ func RespondJSON(w http.ResponseWriter, status int, object interface{}) {
w.Header().Set("Content-Type", "application/json")
w.WriteHeader(status)
if err := json.NewEncoder(w).Encode(object); err != nil {
log.Printf("error while writing json response: %v", err)
logbuch.Error("error while writing json response: %v", err)
}
}