Log -> log

This commit is contained in:
David Wragg committed 2015-08-03 14:13:24 +01:00
1 parent 31c0506b85
commit e7ee72836d
8 files changed
+33 -33

No files matched your search

+9 -9
View File
@@ -40,13 +40,13 @@ func (peer *LocalPeer) Relay(srcPeer, dstPeer *Peer, frame []byte, dec *Ethernet
if !found {
// Not necessarily an error as there could be a race with the
// dst disappearing whilst the frame is in flight
Log.Println("Received packet for unknown destination:", dstPeer)
log.Println("Received packet for unknown destination:", dstPeer)
return nil
}
conn, found := peer.ConnectionTo(relayPeerName)
if !found {
// Again, could just be a race, not necessarily an error
Log.Println("Unable to find connection to relay peer", relayPeerName)
log.Println("Unable to find connection to relay peer", relayPeerName)
return nil
}
return conn.(*LocalConnection).Forward(&ForwardedFrame{
@@ -69,9 +69,9 @@ 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", 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)
log.Errorln(err)
}
}
}
@@ -180,10 +180,10 @@ func (peer *LocalPeer) actorLoop(actionChan <-chan LocalPeerAction) {
func (peer *LocalPeer) handleAddConnection(conn Connection) error {
if peer.Peer != conn.Local() {
Log.Fatal("Attempt made to add connection to peer where peer is not the source of connection")
log.Fatal("Attempt made to add connection to peer where peer is not the source of connection")
}
if conn.Remote() == nil {
Log.Fatal("Attempt made to add connection to peer with unknown remote peer")
log.Fatal("Attempt made to add connection to peer with unknown remote peer")
}
toName := conn.Remote().Name
dupErr := fmt.Errorf("Multiple connections to %s added to %s", conn.Remote(), peer.String())
@@ -222,7 +222,7 @@ func (peer *LocalPeer) handleAddConnection(conn Connection) error {
func (peer *LocalPeer) handleConnectionEstablished(conn Connection) {
if peer.Peer != conn.Local() {
Log.Fatal("Peer informed of active connection where peer is not the source of connection")
log.Fatal("Peer informed of active connection where peer is not the source of connection")
}
if dupConn, found := peer.connections[conn.Remote().Name]; !found || conn != dupConn {
conn.Shutdown(fmt.Errorf("Cannot set unknown connection active"))
@@ -235,10 +235,10 @@ func (peer *LocalPeer) handleConnectionEstablished(conn Connection) {
func (peer *LocalPeer) handleDeleteConnection(conn Connection) {
if peer.Peer != conn.Local() {
Log.Fatal("Attempt made to delete connection from peer where peer is not the source of connection")
log.Fatal("Attempt made to delete connection from peer where peer is not the source of connection")
}
if conn.Remote() == nil {
Log.Fatal("Attempt made to delete connection to peer with unknown remote peer")
log.Fatal("Attempt made to delete connection to peer with unknown remote peer")
}
toName := conn.Remote().Name
if connFound, found := peer.connections[toName]; !found || connFound != conn {