This commit is contained in:
celogeek 2022-01-30 14:50:40 +01:00
parent 87ee1cc6c6
commit 0ccfceb5b3
Signed by: celogeek
GPG Key ID: E6B7BDCFC446233A

View File

@ -1,6 +1,8 @@
package api
import (
"bytes"
"encoding/json"
"net/http"
"github.com/gin-gonic/gin"
@ -17,3 +19,12 @@ func (s *Service) Recovery(c *gin.Context) {
}()
c.Next()
}
func (s *Service) Dump(o interface{}) {
b := bytes.NewBuffer([]byte{})
enc := json.NewEncoder(b)
enc.SetIndent("", " ")
enc.Encode(o)
s.Logger.Printf("%s", b.Bytes())
}