wgengine: log node IDs when peers are added/removed (#381)

Also stop logging data sent/received from nodes we're not connected to (ie all those `x`s being logged in the `peers: ` line)
Signed-off-by: Wendi <wendi.yu@yahoo.ca>
This commit is contained in:
Wendi Yu
2020-05-15 14:13:44 -06:00
committed by GitHub
parent 635f7b99f1
commit bb55694c95
7 changed files with 93 additions and 29 deletions

View File

@@ -13,8 +13,6 @@ import (
"strings"
"testing"
"tailscale.com/types/logger"
"tailscale.com/ipn"
"tailscale.com/ipn/ipnserver"
"tailscale.com/safesocket"
@@ -34,14 +32,12 @@ func TestRunMultipleAccepts(t *testing.T) {
defer os.RemoveAll(td)
socketPath := filepath.Join(td, "tailscale.sock")
ulogf := func(format string, args ...interface{}) {
logf := func(format string, args ...interface{}) {
format = strings.TrimRight(format, "\n")
println(fmt.Sprintf(format, args...))
t.Logf(format, args...)
}
logf := logger.RateLimitedFn(ulogf, 1, 1, 100)
connect := func() {
for i := 1; i <= 2; i++ {
logf("connect %d ...", i)