diff --git a/utils/utils.go b/utils/utils.go index a6f4e3626b..d63e05052e 100644 --- a/utils/utils.go +++ b/utils/utils.go @@ -1,12 +1,15 @@ package utils import ( + "encoding/json" "fmt" "io" "os" "path/filepath" "runtime" "time" + + log "github.com/Sirupsen/logrus" ) func GetHomeDir() string { @@ -95,3 +98,13 @@ func WaitForSpecific(f func() bool, maxAttempts int, waitInterval time.Duration) func WaitFor(f func() bool) error { return WaitForSpecific(f, 60, 3*time.Second) } + +func DumpVal(vals ...interface{}) { + for _, val := range vals { + prettyJSON, err := json.MarshalIndent(val, "", " ") + if err != nil { + log.Fatal(err) + } + log.Debug(string(prettyJSON)) + } +}