diff --git a/wgengine/wglog/wglog.go b/wgengine/wglog/wglog.go index b46651c80..9ce6dcca6 100644 --- a/wgengine/wglog/wglog.go +++ b/wgengine/wglog/wglog.go @@ -52,6 +52,13 @@ func NewLogger(logf logger.Logf) *Logger { // See https://github.com/tailscale/tailscale/issues/1388. return } + if strings.Contains(format, "Adding allowedip") { + // Drop. See https://github.com/tailscale/corp/issues/17532. + // AppConnectors (as one example) may have many subnet routes, and + // the messaging related to these is not specific enough to be + // useful. + return + } replace := ret.replace.Load() if replace == nil { // No replacements specified; log as originally planned. diff --git a/wgengine/wglog/wglog_test.go b/wgengine/wglog/wglog_test.go index b3282e76a..617ed1ff1 100644 --- a/wgengine/wglog/wglog_test.go +++ b/wgengine/wglog/wglog_test.go @@ -64,6 +64,23 @@ func TestLogger(t *testing.T) { } } +func TestSuppressLogs(t *testing.T) { + var logs []string + logf := func(format string, args ...any) { + logs = append(logs, fmt.Sprintf(format, args...)) + } + x := wglog.NewLogger(logf) + x.DeviceLogger.Verbosef("pass") + x.DeviceLogger.Verbosef("UAPI: Adding allowedip") + + if len(logs) != 1 { + t.Fatalf("got %d logs, want 1", len(logs)) + } + if logs[0] != "wg: [v2] pass" { + t.Errorf("got %q, want \"wg: [v2] pass\"", logs[0]) + } +} + func stringer(s string) stringerString { return stringerString(s) }