package util

import (
	"encoding/json"
	"fmt"
	"log"
)

//JSONPrint will marshal a structure into json and fmt print it.
func JSONPrint(i interface{}) {
	if js, err := json.MarshalIndent(i, "", "   "); err == nil {
		fmt.Println(string(js))
	}
}

//JSONLog will marshal a structure into json and log print it.
func JSONLog(i interface{}) {
	if js, err := json.MarshalIndent(i, "", "   "); err == nil {
		log.Println(string(js))
	}
}
