1
0
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:
fumiama
2021-12-30 16:33:28 +08:00
parent 153c36aac8
commit 66c200b708

View File

@@ -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
}
}