util/syspolicy, ipn: add "tailscale debug component-logs" support

Fixes #13313
Fixes #12687

Signed-off-by: Nick Khyl <nickk@tailscale.com>
This commit is contained in:
Nick Khyl
2024-10-08 13:59:50 -05:00
committed by Nick Khyl
parent 29cf59a9b4
commit da40609abd
9 changed files with 101 additions and 17 deletions

View File

@@ -238,6 +238,7 @@ type StateKey string
var DebuggableComponents = []string{
"magicsock",
"sockstats",
"syspolicy",
}
type Options struct {

View File

@@ -583,6 +583,8 @@ func (b *LocalBackend) SetComponentDebugLogging(component string, until time.Tim
}
}
}
case "syspolicy":
setEnabled = syspolicy.SetDebugLoggingEnabled
}
if setEnabled == nil || !slices.Contains(ipn.DebuggableComponents, component) {
return fmt.Errorf("unknown component %q", component)