latest
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
2022-12-09 19:26:55 +01:00
parent cbe9fca1c6
commit 3519389a80
8 changed files with 128 additions and 35 deletions

View File

@@ -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)
}