mirror of
https://github.com/tailscale/tailscale.git
synced 2025-03-28 03:52:35 +00:00
ipn/ipnlocal: automatically upload sockstats logs when the period ends
Avoids needing a separate c2n call to get the logs uploaded. Updates tailscale/corp#9230 Signed-off-by: Mihai Parparita <mihai@tailscale.com>
This commit is contained in:
parent
8d3acc9235
commit
e3cb8cc88d
@ -400,7 +400,14 @@ func (b *LocalBackend) SetComponentDebugLogging(component string, until time.Tim
|
|||||||
setEnabled = mc.SetDebugLoggingEnabled
|
setEnabled = mc.SetDebugLoggingEnabled
|
||||||
case "sockstats":
|
case "sockstats":
|
||||||
if b.sockstatLogger != nil {
|
if b.sockstatLogger != nil {
|
||||||
setEnabled = b.sockstatLogger.SetLoggingEnabled
|
setEnabled = func(v bool) {
|
||||||
|
b.sockstatLogger.SetLoggingEnabled(v)
|
||||||
|
// Flush (and thus upload) logs when the enabled period ends,
|
||||||
|
// so that the logs are available for debugging.
|
||||||
|
if !v {
|
||||||
|
b.sockstatLogger.Flush()
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if setEnabled == nil || !slices.Contains(debuggableComponents, component) {
|
if setEnabled == nil || !slices.Contains(debuggableComponents, component) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user