mirror of
https://github.com/shtorm-7/sing-box-extended.git
synced 2026-10-20 08:14:24 +00:00
Log network path only when changed
This commit is contained in:
@@ -20,6 +20,7 @@ type platformDefaultInterfaceMonitor struct {
|
||||
callbacks list.List[tun.DefaultInterfaceUpdateCallback]
|
||||
myInterfaces []string
|
||||
defaultInterfaceInitialized bool
|
||||
lastNetworkPath string
|
||||
}
|
||||
|
||||
func (m *platformDefaultInterfaceMonitor) Start() error {
|
||||
@@ -57,7 +58,10 @@ func (m *platformDefaultInterfaceMonitor) UnregisterCallback(element *list.Eleme
|
||||
}
|
||||
|
||||
func (m *platformDefaultInterfaceMonitor) UpdateNetworkPath(networkPath string) {
|
||||
m.logger.Debug("updated network path: ", networkPath)
|
||||
if networkPath != m.lastNetworkPath {
|
||||
m.lastNetworkPath = networkPath
|
||||
m.logger.Debug("updated network path: ", networkPath)
|
||||
}
|
||||
if m.powerManager == nil {
|
||||
return
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user