diff --git a/common/signals.go b/common/signals.go index c2e2a683..48ed747c 100644 --- a/common/signals.go +++ b/common/signals.go @@ -20,17 +20,17 @@ func SignalHandlerLoop(ss ...SignalReceiver) { for { switch <-sigs { case syscall.SIGINT, syscall.SIGTERM: - Log.Infof("=== received SIGINT/SIGTERM ===\n*** exiting\n") + Log.Infof("=== received SIGINT/SIGTERM ===\n*** exiting") for _, subsystem := range ss { subsystem.Stop() } return case syscall.SIGQUIT: stacklen := runtime.Stack(buf, true) - Log.Infof("=== received SIGQUIT ===\n*** goroutine dump...\n%s\n*** end\n", buf[:stacklen]) + Log.Infof("=== received SIGQUIT ===\n*** goroutine dump...\n%s\n*** end", buf[:stacklen]) case syscall.SIGUSR1: for _, subsystem := range ss { - Log.Infof("=== received SIGUSR1 ===\n*** status...\n%s\n*** end\n", subsystem.Status()) + Log.Infof("=== received SIGUSR1 ===\n*** status...\n%s\n*** end", subsystem.Status()) } } } diff --git a/ipam/claim.go b/ipam/claim.go index bf5dafcc..63212cd7 100644 --- a/ipam/claim.go +++ b/ipam/claim.go @@ -30,7 +30,7 @@ func (c *claim) sendResult(result error) { func (c *claim) Try(alloc *Allocator) bool { if !alloc.ring.Contains(c.addr) { // Address not within our universe; assume user knows what they are doing - alloc.infof("Ignored address %s claimed by %s - not in our universe\n", c.addr, c.ident) + alloc.infof("Ignored address %s claimed by %s - not in our universe", c.addr, c.ident) c.sendResult(nil) return true } @@ -42,7 +42,7 @@ func (c *claim) Try(alloc *Allocator) bool { case alloc.ourName: // success case router.UnknownPeerName: - alloc.infof("Ring is empty; will try later.\n", c.addr, owner) + alloc.infof("Ring is empty; will try later.", c.addr, owner) c.sendResult(nil) // don't make the caller wait return false default: diff --git a/ipam/ring/ring.go b/ipam/ring/ring.go index fbeeb21b..11d53126 100644 --- a/ipam/ring/ring.go +++ b/ipam/ring/ring.go @@ -218,7 +218,7 @@ func (r *Ring) Merge(gossip Ring) error { switch { case mine.Version >= theirs.Version: if mine.Version == theirs.Version && !mine.Equal(theirs) { - common.Log.Debugf("Error merging entries at %s - %v != %v\n", mine.Token, mine, theirs) + common.Log.Debugf("Error merging entries at %s - %v != %v", mine.Token, mine, theirs) return ErrInvalidEntry } addToResult(*mine) diff --git a/prog/weavedns/main.go b/prog/weavedns/main.go index 06aa0780..c8217656 100644 --- a/prog/weavedns/main.go +++ b/prog/weavedns/main.go @@ -71,7 +71,7 @@ func main() { } SetLogLevel(logLevel) - Log.Infof("[main] WeaveDNS version %s\n", version) // first thing in log: the version + Log.Infof("[main] WeaveDNS version %s", version) // first thing in log: the version var iface *net.Interface if ifaceName != "" { diff --git a/router/connection.go b/router/connection.go index 3f5396f7..709d02cc 100644 --- a/router/connection.go +++ b/router/connection.go @@ -408,7 +408,7 @@ func (conn *LocalConnection) actorLoop(actionChan <-chan ConnectionAction) (err func (conn *LocalConnection) shutdown(err error) { if conn.remote == nil { - Log.Errorf("->[%s] connection shutting down due to error during handshake: %v\n", conn.remoteTCPAddr, err) + Log.Errorf("->[%s] connection shutting down due to error during handshake: %v", conn.remoteTCPAddr, err) } else { conn.ErrorLog("connection shutting down due to error:", err) } diff --git a/router/connection_maker.go b/router/connection_maker.go index acb1102d..9c65ce28 100644 --- a/router/connection_maker.go +++ b/router/connection_maker.go @@ -299,9 +299,9 @@ func (cm *ConnectionMaker) connectToTargets(validTarget map[string]struct{}, dir } func (cm *ConnectionMaker) attemptConnection(address string, acceptNewPeer bool) { - Log.Printf("->[%s] attempting connection\n", address) + Log.Printf("->[%s] attempting connection", address) if err := cm.ourself.CreateConnection(address, acceptNewPeer); err != nil { - Log.Errorf("->[%s] error during connection attempt: %v\n", address, err) + Log.Errorf("->[%s] error during connection attempt: %v", address, err) cm.ConnectionTerminated(address, err) } } diff --git a/router/ethernet_decoder.go b/router/ethernet_decoder.go index 0404f182..84a96d0d 100644 --- a/router/ethernet_decoder.go +++ b/router/ethernet_decoder.go @@ -61,7 +61,7 @@ func (dec *EthernetDecoder) sendICMPFragNeeded(mtu int, sendFrame func([]byte) e return err } - Log.Printf("Sending ICMP 3,4 (%v -> %v): PMTU= %v\n", dec.IP.DstIP, dec.IP.SrcIP, mtu) + Log.Printf("Sending ICMP 3,4 (%v -> %v): PMTU= %v", dec.IP.DstIP, dec.IP.SrcIP, mtu) return sendFrame(buf.Bytes()) } diff --git a/router/local_peer.go b/router/local_peer.go index 3c9ac880..183afed5 100644 --- a/router/local_peer.go +++ b/router/local_peer.go @@ -71,7 +71,7 @@ func (peer *LocalPeer) RelayBroadcast(srcPeer *Peer, frame []byte, dec *Ethernet dec) if err != nil { if ftbe, ok := err.(FrameTooBigError); ok { - Log.Warningf("dropping too big DF broadcast frame (%v -> %v): PMTU= %v\n", dec.IP.DstIP, dec.IP.SrcIP, ftbe.EPMTU) + Log.Warningf("dropping too big DF broadcast frame (%v -> %v): PMTU= %v", dec.IP.DstIP, dec.IP.SrcIP, ftbe.EPMTU) } else { Log.Errorln(err) } diff --git a/router/router.go b/router/router.go index f4a254fc..4a1ae62d 100644 --- a/router/router.go +++ b/router/router.go @@ -215,7 +215,7 @@ func (router *Router) acceptTCP(tcpConn *net.TCPConn) { // on router.Port and we wait for them to send us something on UDP to // start. remoteAddrStr := tcpConn.RemoteAddr().String() - Log.Printf("->[%s] connection accepted\n", remoteAddrStr) + Log.Printf("->[%s] connection accepted", remoteAddrStr) connRemote := NewRemoteConnection(router.Ourself.Peer, nil, remoteAddrStr, false, false) StartLocalConnection(connRemote, tcpConn, nil, router, true) }