This commit is contained in:
@@ -23,11 +23,20 @@ func DisableStyling() {
|
||||
pterm.Fatal.Prefix.Text = ""
|
||||
}
|
||||
|
||||
var TestingTraces bool = false
|
||||
|
||||
func Init() {
|
||||
log.SetHandler(acli.Default)
|
||||
log.SetLevel(log.InfoLevel)
|
||||
}
|
||||
|
||||
func Tracef(format string, args ...interface{}) {
|
||||
if !TestingTraces {
|
||||
return
|
||||
}
|
||||
DebugReal(fmt.Sprintf(format, args...), 2)
|
||||
}
|
||||
|
||||
func Debugf(format string, args ...interface{}) {
|
||||
DebugReal(fmt.Sprintf(format, args...), 2)
|
||||
}
|
||||
@@ -45,10 +54,22 @@ func DebugReal(arg string, cs int) {
|
||||
log.Debug(tag + arg)
|
||||
}
|
||||
|
||||
func TraceDump(args ...interface{}) {
|
||||
if !TestingTraces {
|
||||
return
|
||||
}
|
||||
DebugReal(spew.Sdump(args...), 2)
|
||||
}
|
||||
|
||||
func Dump(args ...interface{}) {
|
||||
DebugReal(spew.Sdump(args...), 2)
|
||||
}
|
||||
|
||||
func EnableTestingLogging() {
|
||||
TestingTraces = true
|
||||
EnableDebugLogging()
|
||||
}
|
||||
|
||||
func EnableDebugLogging() {
|
||||
SetLevel(log.DebugLevel)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user