7
0
gaore-common-sdk-go/sdk/utils/debug.go
2020-08-06 12:15:51 +08:00

19 lines
295 B
Go

package utils
import "fmt"
type Debug func(format string, v ...interface{})
var hookPrint = func(input string) {
fmt.Println(input)
}
func Init(flag string, enable bool) Debug {
return func(format string, v ...interface{}) {
if enable {
hookPrint(fmt.Sprintf(format, v...))
}
}
}