mirror of
https://github.com/tailscale/tailscale.git
synced 2025-10-24 17:48:57 +00:00
wgengine/wglog: quieten WireGuard logs for allowedips
An increasing number of users have very large subnet route configurations, which can produce very large amounts of log data when WireGuard is reconfigured. The logs don't contain the actual routes, so they're largely useless for diagnostics, so we'll just suppress them. Fixes tailscale/corp#17532 Signed-off-by: James Tucker <james@tailscale.com>
This commit is contained in:
committed by
James Tucker
parent
e8d2fc7f7f
commit
131f9094fd
@@ -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)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user