getting warmer
This commit is contained in:
@@ -1,6 +1,9 @@
|
||||
package log
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"runtime"
|
||||
|
||||
"github.com/apex/log"
|
||||
acli "github.com/apex/log/handlers/cli"
|
||||
"github.com/davecgh/go-spew/spew"
|
||||
@@ -25,13 +28,25 @@ func Init() {
|
||||
log.SetLevel(log.InfoLevel)
|
||||
}
|
||||
|
||||
func Debugf(format string, args ...interface{}) {
|
||||
DebugReal(fmt.Sprintf(format, args...), 2)
|
||||
}
|
||||
|
||||
func Debug(arg string) {
|
||||
log.Debug(arg)
|
||||
DebugReal(arg, 2)
|
||||
}
|
||||
|
||||
func DebugReal(arg string, cs int) {
|
||||
_, callerFile, callerLine, ok := runtime.Caller(cs)
|
||||
if !ok {
|
||||
return
|
||||
}
|
||||
tag := fmt.Sprintf("%s:%d: ", callerFile, callerLine)
|
||||
log.Debug(tag + arg)
|
||||
}
|
||||
|
||||
func Dump(args ...interface{}) {
|
||||
str := spew.Sdump(args...)
|
||||
Debug(str)
|
||||
DebugReal(spew.Sdump(args...), 2)
|
||||
}
|
||||
|
||||
func EnableDebugLogging() {
|
||||
|
||||
Reference in New Issue
Block a user