mirror of
https://github.com/SagerNet/sing-box.git
synced 2026-10-21 19:44:13 +00:00
Log network path only when changed
This commit is contained in:
parent
21ba30b8c3
commit
cdea9e87f1
1 changed files with 5 additions and 1 deletions
|
|
@ -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
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue