mirror of
https://github.com/tailscale/tailscale.git
synced 2025-10-23 09:10:04 +00:00
wgengine/router: add debug logging component logs
This uses the "component logging" feature to allow turning on additional debug logs for the Router at runtime. Currently, it's only implemented on Linux and with the CallbackRouter at this time. Updates #13887 Signed-off-by: Andrew Dunham <andrew@du.nham.ca> Change-Id: I251a7705765f950d118850f1e14f465729ba45c5
This commit is contained in:
@@ -566,7 +566,9 @@ func componentStateKey(component string) ipn.StateKey {
|
||||
// The following components are recognized:
|
||||
//
|
||||
// - magicsock
|
||||
// - router
|
||||
// - sockstats
|
||||
// - syspolicy
|
||||
func (b *LocalBackend) SetComponentDebugLogging(component string, until time.Time) error {
|
||||
b.mu.Lock()
|
||||
defer b.mu.Unlock()
|
||||
@@ -575,6 +577,12 @@ func (b *LocalBackend) SetComponentDebugLogging(component string, until time.Tim
|
||||
switch component {
|
||||
case "magicsock":
|
||||
setEnabled = b.MagicConn().SetDebugLoggingEnabled
|
||||
case "router":
|
||||
if r, ok := b.sys.Router.GetOK(); ok {
|
||||
setEnabled = r.SetDebugLoggingEnabled
|
||||
} else {
|
||||
return fmt.Errorf("no router available")
|
||||
}
|
||||
case "sockstats":
|
||||
if b.sockstatLogger != nil {
|
||||
setEnabled = func(v bool) {
|
||||
|
Reference in New Issue
Block a user