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>
This commit is contained in:
Jason A. Donenfeld
2021-01-26 23:05:48 +01:00
parent 7139279cd0
commit d669c78c43
13 changed files with 109 additions and 133 deletions

View File

@@ -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()