From e2bf1edeb7d491f659492fb51bc8b88ef5743b94 Mon Sep 17 00:00:00 2001
From: Christoph Petrausch <christoph.petrausch@inovex.de>
Date: Tue, 29 May 2018 06:58:50 +0200
Subject: [PATCH] Added logging to locRib

---
 routingtable/locRIB/loc_rib.go | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/routingtable/locRIB/loc_rib.go b/routingtable/locRIB/loc_rib.go
index a1701743..ff5750c3 100644
--- a/routingtable/locRIB/loc_rib.go
+++ b/routingtable/locRIB/loc_rib.go
@@ -8,6 +8,7 @@ import (
 	"github.com/bio-routing/bio-rd/net"
 	"github.com/bio-routing/bio-rd/route"
 	"github.com/bio-routing/bio-rd/routingtable"
+	"github.com/sirupsen/logrus"
 )
 
 // LocRIB represents a routing information base
@@ -44,6 +45,10 @@ func (a *LocRIB) AddPath(pfx net.Prefix, p *route.Path) error {
 	a.mu.Lock()
 	defer a.mu.Unlock()
 
+	logrus.WithFields(map[string]interface{}{
+		"Prefix": pfx,
+		"Route":  p,
+	}).Debug("AddPath to locRIB")
 	routeExisted := false
 	oldRoute := &route.Route{}
 	r := a.rt.Get(pfx)
@@ -70,6 +75,10 @@ func (a *LocRIB) RemovePath(pfx net.Prefix, p *route.Path) bool {
 	a.mu.Lock()
 	defer a.mu.Unlock()
 
+	logrus.WithFields(map[string]interface{}{
+		"Prefix": pfx,
+		"Route":  p,
+	}).Debug("Remove from locRIB")
 	var oldRoute *route.Route
 	r := a.rt.Get(pfx)
 	if r != nil {
-- 
GitLab