qrz/vendor/github.com/markbates/oncer/log_debug.go
Paul Lecuq 36c5d6f2ed
Some checks failed
continuous-integration/drone/push Build is passing
continuous-integration/drone/tag Build is failing
large change on qrz
- web service with json support
- web page
- cron service to update database infos
2020-05-09 19:09:27 +02:00

20 lines
260 B
Go

//+build debug
package oncer
import (
"fmt"
"time"
)
func log(name string, fn func()) func() {
return func() {
start := time.Now()
if len(name) > 80 {
name = name[(len(name) - 80):]
}
defer fmt.Println(name, time.Now().Sub(start))
fn()
}
}