mirror of
https://github.com/fumiama/WireGold.git
synced 2026-06-11 20:20:27 +08:00
add some logs
This commit is contained in:
@@ -5,6 +5,7 @@ import (
|
|||||||
"net"
|
"net"
|
||||||
"sync"
|
"sync"
|
||||||
|
|
||||||
|
"github.com/fumiama/WireGold/helper"
|
||||||
"github.com/sirupsen/logrus"
|
"github.com/sirupsen/logrus"
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -84,7 +85,11 @@ func (r *Router) SetItem(ip *net.IPNet, l *Link) {
|
|||||||
copy(r.list[i+1:], r.list[i:len(r.list)-1])
|
copy(r.list[i+1:], r.list[i:len(r.list)-1])
|
||||||
r.list[i] = ip
|
r.list[i] = ip
|
||||||
r.table[ip.String()] = l
|
r.table[ip.String()] = l
|
||||||
logrus.Infoln("[router] add route in link", l.pubk[:24], "to", ip, "-->", l.peerip)
|
lnkname := "default"
|
||||||
|
if l.pubk != nil {
|
||||||
|
lnkname = helper.BytesToString(l.pubk[:24])
|
||||||
|
}
|
||||||
|
logrus.Infoln("[router] add route in link", lnkname, "to", ip, "-->", l.peerip)
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user