mirror of
https://github.com/ysoftdevs/gardener-extension-shoot-fleet-agent.git
synced 2026-03-18 23:34:20 +01:00
20 lines
260 B
Go
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()
|
|
}
|
|
}
|