From: Josh Bleecher Snyder Date: Wed, 6 Jan 2021 00:04:38 +0000 (-0800) Subject: device: use LogLevelError for benchmarking X-Git-Tag: 0.0.20210212~107 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8a304155554a16285b5334ae4a02e09adfb0bde1;p=thirdparty%2Fwireguard-go.git device: use LogLevelError for benchmarking This keeps the output minimal and focused on the benchmark results. Signed-off-by: Josh Bleecher Snyder --- diff --git a/device/device_test.go b/device/device_test.go index 6cfe22f..09b5152 100644 --- a/device/device_test.go +++ b/device/device_test.go @@ -146,7 +146,11 @@ NextAttempt: } else { p.ip = net.ParseIP("1.0.0.2") } - p.dev = NewDevice(p.tun.TUN(), NewLogger(LogLevelDebug, fmt.Sprintf("dev%d: ", i))) + level := LogLevelDebug + if _, ok := tb.(*testing.B); ok && !testing.Verbose() { + level = LogLevelError + } + p.dev = NewDevice(p.tun.TUN(), NewLogger(level, fmt.Sprintf("dev%d: ", i))) p.dev.Up() if err := p.dev.IpcSetOperation(cfg[i]); err != nil { // genConfigs attempted to pick ports that were free.