func Fprintf(w io.Writer, format string, a ...interface{}) (n int, err error) {
	return defaultPrettyPrinter.Fprintf(w, format, a...)
}
Fprintf prints format to a given writer.
package pp
import (
	"errors"
	"fmt"
	"io"
	"os"
	"runtime"
	"sync"
	"github.com/mattn/go-colorable"
)
var (
	defaultOut           = colorable.NewColorableStdout()
	defaultWithLineInfo  = false
	defaultPrettyPrinter = newPrettyPrinter(3)  
)
type PrettyPrinter struct {
	out           io.Writer
	currentScheme ColorScheme
	WithLineInfo    bool
	outLock         sync.Mutex
	maxDepth        int
	coloringEnabled bool
	callerLevel     int
}
func New() *PrettyPrinter {
	return newPrettyPrinter(2)  
}
func newPrettyPrinter(callerLevel int) *PrettyPrinter {
	return &PrettyPrinter{
		out:             defaultOut,
		currentScheme:   defaultScheme,
		WithLineInfo:    defaultWithLineInfo,
		maxDepth:        -1,
		coloringEnabled: true,
		callerLevel:     callerLevel,
	}
}
func (pp *PrettyPrinter) Print(a ...interface{}) (n int, err error) {
	return fmt.Fprint(pp.out, pp.formatAll(a)...)
}
func (pp *PrettyPrinter) Printf(format string, a ...interface{}) (n int, err error) {
	return fmt.Fprintf(pp.out, format, pp.formatAll(a)...)
}
func (pp *PrettyPrinter) Println(a ...interface{}) (n int, err error) {
	return fmt.Fprintln(pp.out, pp.formatAll(a)...)
}
func (pp *PrettyPrinter) Sprint(a ...interface{}) string {
	return fmt.Sprint(pp.formatAll(a)...)
}
func (pp *PrettyPrinter) Sprintf(format string, a ...interface{}) string {
	return fmt.Sprintf(format, pp.formatAll(a)...)
}
func (pp *PrettyPrinter) Sprintln(a ...interface{}) string {
	return fmt.Sprintln(pp.formatAll(a)...)
}
func (pp *PrettyPrinter) Fprint(w io.Writer, a ...interface{}) (n int, err error) {
	return fmt.Fprint(w, pp.formatAll(a)...)
}
func (pp *PrettyPrinter) Fprintf(w io.Writer, format string, a ...interface{}) (n int, err error) {
	return fmt.Fprintf(w, format, pp.formatAll(a)...)
}
func (pp *PrettyPrinter) Fprintln(w io.Writer, a ...interface{}) (n int, err error) {
	return fmt.Fprintln(w, pp.formatAll(a)...)
}
func (pp *PrettyPrinter) Errorf(format string, a ...interface{}) error {
	return errors.New(pp.Sprintf(format, a...))
}
func (pp *PrettyPrinter) Fatal(a ...interface{}) {
	fmt.Fprint(pp.out, pp.formatAll(a)...)
	os.Exit(1)
}
func (pp *PrettyPrinter) Fatalf(format string, a ...interface{}) {
	fmt.Fprintf(pp.out, format, pp.formatAll(a)...)
	os.Exit(1)
}
func (pp *PrettyPrinter) Fatalln(a ...interface{}) {
	fmt.Fprintln(pp.out, pp.formatAll(a)...)
	os.Exit(1)
}
func (pp *PrettyPrinter) SetColoringEnabled(enabled bool) {
	pp.coloringEnabled = enabled
}
func (pp *PrettyPrinter) SetOutput(o io.Writer) {
	pp.outLock.Lock()
	defer pp.outLock.Unlock()
	pp.out = o
}
func (pp *PrettyPrinter) GetOutput() io.Writer {
	return pp.out
}
func (pp *PrettyPrinter) ResetOutput() {
	pp.outLock.Lock()
	defer pp.outLock.Unlock()
	pp.out = defaultOut
}
func (pp *PrettyPrinter) SetColorScheme(scheme ColorScheme) {
	scheme.fixColors()
	pp.currentScheme = scheme
}
func (pp *PrettyPrinter) ResetColorScheme() {
	pp.currentScheme = defaultScheme
}
func (pp *PrettyPrinter) formatAll(objects []interface{}) []interface{} {
	results := []interface{}{}
	withLineInfo := pp.WithLineInfo
	if pp == defaultPrettyPrinter {
		withLineInfo = WithLineInfo
	}
	if withLineInfo {
		_, fn, line, _ := runtime.Caller(pp.callerLevel)
		results = append(results, fmt.Sprintf("%s:%d\n", fn, line))
	}
	for _, object := range objects {
		results = append(results, pp.format(object))
	}
	return results
}
func Print(a ...interface{}) (n int, err error) {
	return defaultPrettyPrinter.Print(a...)
}
func Printf(format string, a ...interface{}) (n int, err error) {
	return defaultPrettyPrinter.Printf(format, a...)
}
func Println(a ...interface{}) (n int, err error) {
	return defaultPrettyPrinter.Println(a...)
}
func Sprint(a ...interface{}) string {
	return defaultPrettyPrinter.Sprint(a...)
}
func Sprintf(format string, a ...interface{}) string {
	return defaultPrettyPrinter.Sprintf(format, a...)
}
func Sprintln(a ...interface{}) string {
	return defaultPrettyPrinter.Sprintln(a...)
}
func Fprint(w io.Writer, a ...interface{}) (n int, err error) {
	return defaultPrettyPrinter.Fprint(w, a...)
}