mirror of
https://github.com/fumiama/WireGold.git
synced 2026-06-05 07:50:24 +08:00
add some logs
This commit is contained in:
@@ -5,6 +5,7 @@ import (
|
||||
"net"
|
||||
"sync"
|
||||
|
||||
"github.com/fumiama/WireGold/helper"
|
||||
"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])
|
||||
r.list[i] = ip
|
||||
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
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user