Archived
1
This repository has been archived on 2022-11-04. You can view files and clone it, but cannot push or open issues or pull requests.
fwzookeeper/vendor/github.com/kirillDanshin/dlog/dlog_enabled.go

39 lines
565 B
Go
Raw Normal View History

2018-11-29 20:32:51 +04:00
// +build debug
package dlog
import (
"fmt"
"log"
"github.com/davecgh/go-spew/spew"
)
var spewInstance = spew.ConfigState{
Indent: "\t",
}
// D dumps a value
func D(v ...interface{}) {
for _, v := range v {
spewInstance.Dump(v)
}
}
// F is a build-time enabled printf
func F(f string, v ...interface{}) {
// log.Printf(f, v...)
spewInstance.Printf(f+"\n", v...)
}
// P is a build-time enabled print
func P(v ...interface{}) {
log.Print(v...)
fmt.Println()
}
// Ln is a build-time enabled println
func Ln(v ...interface{}) {
log.Println(v...)
}