geziyor/exporter/pprint.go

21 lines
399 B
Go

package exporter
import (
"encoding/json"
"fmt"
)
// PrettyPrint logs exported data to console as pretty printed
type PrettyPrint struct{}
// Export logs exported data to console as pretty printed
func (*PrettyPrint) Export(exports chan interface{}) {
for res := range exports {
dat, err := json.MarshalIndent(res, "", " ")
if err != nil {
continue
}
fmt.Println(string(dat))
}
}