aboutsummaryrefslogtreecommitdiffstats
path: root/device/peer.go
diff options
context:
space:
mode:
authorJason A. Donenfeld <Jason@zx2c4.com>2021-01-26 23:05:48 +0100
committerJason A. Donenfeld <Jason@zx2c4.com>2021-01-26 23:05:48 +0100
commitd669c78c4306290963415568f4a64a1ae2b35b20 (patch)
tree189a833daf57ffded2e177bfe5a554fd1b886392 /device/peer.go
parentdevice: change logging interface to use functions (diff)
downloadwireguard-go-d669c78c4306290963415568f4a64a1ae2b35b20.tar.xz
wireguard-go-d669c78c4306290963415568f4a64a1ae2b35b20.zip
device: combine debug and info log levels into 'verbose'
There are very few cases, if any, in which a user only wants one of these levels, so combine it into a single level. While we're at it, reduce indirection on the loggers by using an empty function rather than a nil function pointer. It's not like we have retpolines anyway, and we were always calling through a function with a branch prior, so this seems like a net gain. Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
Diffstat (limited to 'device/peer.go')
-rw-r--r--device/peer.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/device/peer.go b/device/peer.go
index 46edaeb..5324ae4 100644
--- a/device/peer.go
+++ b/device/peer.go
@@ -190,7 +190,7 @@ func (peer *Peer) Start() {
}
device := peer.device
- device.debugf("%v - Starting...", peer)
+ device.log.Verbosef("%v - Starting...", peer)
// reset routine state
@@ -278,7 +278,7 @@ func (peer *Peer) Stop() {
peer.routines.Lock()
defer peer.routines.Unlock()
- peer.device.debugf("%v - Stopping...", peer)
+ peer.device.log.Verbosef("%v - Stopping...", peer)
peer.timersStop()