Pretty print exporter added. Panic counter added to metrics
This commit is contained in:
20
exporter/pprint.go
Normal file
20
exporter/pprint.go
Normal file
@ -0,0 +1,20 @@
|
||||
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))
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user