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

@@ -15,6 +15,7 @@ import (
"net/http"
"net/http/pprof"
"runtime"
"time"
"github.com/apenwarr/fixconsole"
"github.com/pborman/getopt/v2"
@@ -52,7 +53,7 @@ func main() {
socketpath := getopt.StringLong("socket", 's', paths.DefaultTailscaledSocket(), "Path of the service unix socket")
logf := wgengine.RusagePrefixLog(log.Printf)
logf = logger.RateLimitedFn(logf, 1, 1, 100)
logf = logger.RateLimitedFn(logf, 1*time.Second, 1, 100)
err := fixconsole.FixConsoleIfNeeded()
if err != nil {