Skip to content
Snippets Groups Projects
Commit e2bf1ede authored by Christoph Petrausch's avatar Christoph Petrausch
Browse files

Added logging to locRib

parent 06042b9c
No related branches found
No related tags found
No related merge requests found
...@@ -8,6 +8,7 @@ import ( ...@@ -8,6 +8,7 @@ import (
"github.com/bio-routing/bio-rd/net" "github.com/bio-routing/bio-rd/net"
"github.com/bio-routing/bio-rd/route" "github.com/bio-routing/bio-rd/route"
"github.com/bio-routing/bio-rd/routingtable" "github.com/bio-routing/bio-rd/routingtable"
"github.com/sirupsen/logrus"
) )
// LocRIB represents a routing information base // LocRIB represents a routing information base
...@@ -44,6 +45,10 @@ func (a *LocRIB) AddPath(pfx net.Prefix, p *route.Path) error { ...@@ -44,6 +45,10 @@ func (a *LocRIB) AddPath(pfx net.Prefix, p *route.Path) error {
a.mu.Lock() a.mu.Lock()
defer a.mu.Unlock() defer a.mu.Unlock()
logrus.WithFields(map[string]interface{}{
"Prefix": pfx,
"Route": p,
}).Debug("AddPath to locRIB")
routeExisted := false routeExisted := false
oldRoute := &route.Route{} oldRoute := &route.Route{}
r := a.rt.Get(pfx) r := a.rt.Get(pfx)
...@@ -70,6 +75,10 @@ func (a *LocRIB) RemovePath(pfx net.Prefix, p *route.Path) bool { ...@@ -70,6 +75,10 @@ func (a *LocRIB) RemovePath(pfx net.Prefix, p *route.Path) bool {
a.mu.Lock() a.mu.Lock()
defer a.mu.Unlock() defer a.mu.Unlock()
logrus.WithFields(map[string]interface{}{
"Prefix": pfx,
"Route": p,
}).Debug("Remove from locRIB")
var oldRoute *route.Route var oldRoute *route.Route
r := a.rt.Get(pfx) r := a.rt.Get(pfx)
if r != nil { if r != nil {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment