tighten up logging

This commit is contained in:
Pim van Pelt
2025-06-24 07:51:37 +02:00
parent 3401c96112
commit 8ed14834f5
4 changed files with 13 additions and 9 deletions

View File

@@ -105,14 +105,14 @@ func (im *InterfaceManager) eventMonitoringRoutine() {
if im.client.IsConnected() {
if !im.watchingEvents {
if err := im.InitializeEventWatching(); err != nil {
logger.Debugf("Failed to initialize interface event watching: %v", err)
logger.Printf("Failed to initialize interface event watching: %v", err)
} else {
logger.Debugf("Interface event watching restarted after reconnection")
logger.Printf("Interface event watching started")
}
}
} else {
if im.watchingEvents {
logger.Debugf("VPP connection lost, interface event watching will restart on reconnection")
logger.Printf("VPP connection lost, interface event watching will restart on reconnection")
im.watchingEvents = false
}
}
@@ -264,7 +264,7 @@ func watchInterfaceEvents(ch api.Channel, callback func()) error {
logger.Debugf("Interface event listener waiting for events...")
for notif := range notifChan {
e := notif.(*interfaces.SwInterfaceEvent)
logger.Debugf("interface event: SwIfIndex=%d, Flags=%d, Deleted=%t",
logger.Printf("interface event: SwIfIndex=%d, Flags=%d, Deleted=%t",
e.SwIfIndex, e.Flags, e.Deleted)
// When an interface event occurs, call the callback