diff options
author | Jason A. Donenfeld <Jason@zx2c4.com> | 2021-01-26 23:05:48 +0100 |
---|---|---|
committer | Jason A. Donenfeld <Jason@zx2c4.com> | 2021-01-26 23:05:48 +0100 |
commit | d669c78c4306290963415568f4a64a1ae2b35b20 (patch) | |
tree | 189a833daf57ffded2e177bfe5a554fd1b886392 /device/noise-protocol.go | |
parent | 7139279cd0b08ebbd2c0322bc01d5678aa00cd0e (diff) |
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/noise-protocol.go')
-rw-r--r-- | device/noise-protocol.go | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/device/noise-protocol.go b/device/noise-protocol.go index df520d0..5669381 100644 --- a/device/noise-protocol.go +++ b/device/noise-protocol.go @@ -319,11 +319,11 @@ func (device *Device) ConsumeMessageInitiation(msg *MessageInitiation) *Peer { flood := time.Since(handshake.lastInitiationConsumption) <= HandshakeInitationRate handshake.mutex.RUnlock() if replay { - device.debugf("%v - ConsumeMessageInitiation: handshake replay @ %v", peer, timestamp) + device.log.Verbosef("%v - ConsumeMessageInitiation: handshake replay @ %v", peer, timestamp) return nil } if flood { - device.debugf("%v - ConsumeMessageInitiation: handshake flood", peer) + device.log.Verbosef("%v - ConsumeMessageInitiation: handshake flood", peer) return nil } |