diff --git a/internal/photos/api/helpers.go b/internal/photos/api/helpers.go index f6efc3d..a66f262 100644 --- a/internal/photos/api/helpers.go +++ b/internal/photos/api/helpers.go @@ -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()) +}