diff options
author | Mathias Hall-Andersen <mathias@hall-andersen.dk> | 2018-02-04 19:18:44 +0100 |
---|---|---|
committer | Mathias Hall-Andersen <mathias@hall-andersen.dk> | 2018-02-04 19:18:44 +0100 |
commit | ceccd394200b9152f4df57e5bbe7d7e9002b8704 (patch) | |
tree | 877ac749a2bdde2d1455630a211134bbc31edb1b /send.go | |
parent | 283e7117cfd4be3c524701de20307faef7ebcf86 (diff) |
Work on logging format
Diffstat (limited to 'send.go')
-rw-r--r-- | send.go | 14 |
1 files changed, 9 insertions, 5 deletions
@@ -187,13 +187,16 @@ func (device *Device) RoutineReadFromTUN() { func (peer *Peer) RoutineNonce() { var keyPair *KeyPair - defer peer.routines.stopping.Done() - device := peer.device logDebug := device.log.Debug - logDebug.Println("Routine, nonce worker, started for peer", peer.String()) + + defer func() { + peer.routines.stopping.Done() + logDebug.Println(peer.String(), ": Routine, Nonce Worker, Stopped") + }() peer.routines.starting.Done() + logDebug.Println(peer.String(), ": Routine, Nonce Worker, Started") for { NextPacket: @@ -215,12 +218,13 @@ func (peer *Peer) RoutineNonce() { peer.signal.handshakeBegin.Send() - logDebug.Println("Awaiting key-pair for", peer.String()) + logDebug.Println(peer.String(), ": Awaiting key-pair") select { case <-peer.signal.newKeyPair.Wait(): + logDebug.Println(peer.String(), ": Obtained awaited key-pair") case <-peer.signal.flushNonceQueue.Wait(): - logDebug.Println("Clearing queue for", peer.String()) + logDebug.Println(peer.String(), ": Flushing nonce queue") peer.FlushNonceQueue() goto NextPacket case <-peer.routines.stop.Wait(): |