Pretty print exporter added. Panic counter added to metrics

This commit is contained in:
Musab Gültekin
2019-06-29 11:20:06 +03:00
parent 276b248ebb
commit 59757607eb
4 changed files with 32 additions and 3 deletions

20
exporter/pprint.go Normal file
View 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))
}
}