src: Adding log4cxx logging

Refs: #1505

Change-Id: Ib154d91f81acf3f1dd8bbcf552062a16d03fec74
diff --git a/src/route/name-prefix-table-entry.cpp b/src/route/name-prefix-table-entry.cpp
index cb7b869..9a734f7 100644
--- a/src/route/name-prefix-table-entry.cpp
+++ b/src/route/name-prefix-table-entry.cpp
@@ -3,9 +3,12 @@
 #include "name-prefix-table-entry.hpp"
 #include "routing-table-entry.hpp"
 #include "nexthop.hpp"
+#include "logger.hpp"
 
 namespace nlsr {
 
+INIT_LOGGER("NamePrefixTableEntry");
+
 using namespace std;
 
 void
@@ -65,6 +68,19 @@
   }
 }
 
+void
+NamePrefixTableEntry::writeLog()
+{
+  _LOG_DEBUG("Name: " << m_namePrefix);
+  for (std::list<RoutingTableEntry>::iterator it = m_rteList.begin();
+       it != m_rteList.end(); ++it) {
+    _LOG_DEBUG("Destination: " << (*it).getDestination());
+    _LOG_DEBUG("Nexthops: ");
+    (*it).getNexthopList().writeLog();
+  }
+  m_nexthopList.writeLog();
+}
+
 //debugging purpose
 ostream&
 operator<<(ostream& os, NamePrefixTableEntry& npte)