diff --git a/src/route/face-map.cpp b/src/route/face-map.cpp
index 26d4390..95a37bf 100644
--- a/src/route/face-map.cpp
+++ b/src/route/face-map.cpp
@@ -20,12 +20,12 @@
  * \author A K M Mahmudul Hoque <ahoque1@memphis.edu>
  *
  **/
-#include <iostream>
-#include <utility>
-
+#include "face-map.hpp"
 #include "common.hpp"
 #include "logger.hpp"
-#include "face-map.hpp"
+
+#include <iostream>
+#include <utility>
 
 namespace nlsr {
 
@@ -34,9 +34,9 @@
 void
 FaceMap::writeLog()
 {
-  _LOG_DEBUG("------- Face Map-----------");
+  NLSR_LOG_DEBUG("------- Face Map-----------");
   for (const auto& it : m_table) {
-    _LOG_DEBUG("Face Map Entry (FaceUri: " << (it.second).getFaceUri()
+    NLSR_LOG_DEBUG("Face Map Entry (FaceUri: " << (it.second).getFaceUri()
                << " Face Id: " << (it.second).getFaceId() << ")");
   }
 }
diff --git a/src/route/fib-entry.cpp b/src/route/fib-entry.cpp
index 91eb422..4a4498a 100644
--- a/src/route/fib-entry.cpp
+++ b/src/route/fib-entry.cpp
@@ -28,8 +28,8 @@
 void
 FibEntry::writeLog()
 {
-  _LOG_DEBUG("Name Prefix: " << m_name);
-  _LOG_DEBUG("Seq No: " << m_seqNo);
+  NLSR_LOG_DEBUG("Name Prefix: " << m_name);
+  NLSR_LOG_DEBUG("Seq No: " << m_seqNo);
   m_nexthopList.writeLog();
 }
 
diff --git a/src/route/fib.cpp b/src/route/fib.cpp
index 752b15a..d8a9909 100644
--- a/src/route/fib.cpp
+++ b/src/route/fib.cpp
@@ -38,7 +38,7 @@
 void
 Fib::remove(const ndn::Name& name)
 {
-  _LOG_DEBUG("Fib::remove called");
+  NLSR_LOG_DEBUG("Fib::remove called");
   std::map<ndn::Name, FibEntry>::iterator it = m_table.find(name);
   if (it != m_table.end()) {
     for (std::set<NextHop, NextHopComparator>::iterator nhit =
@@ -78,7 +78,7 @@
 void
 Fib::update(const ndn::Name& name, NexthopList& allHops)
 {
-  _LOG_DEBUG("Fib::update called");
+  NLSR_LOG_DEBUG("Fib::update called");
 
   // Get the max possible faces which is the minumum of the configuration setting and
   // the length of the list of all next hops.
@@ -97,7 +97,7 @@
 
   // New FIB entry that has nextHops
   if (entryIt == m_table.end() && hopsToAdd.size() != 0) {
-    _LOG_DEBUG("New FIB Entry");
+    NLSR_LOG_DEBUG("New FIB Entry");
 
     FibEntry entry(name);
 
@@ -110,7 +110,7 @@
   // Existing FIB entry that may or may not have nextHops
   else {
     // Existing FIB entry
-    _LOG_DEBUG("Existing FIB Entry");
+    NLSR_LOG_DEBUG("Existing FIB Entry");
 
     // Remove empty FIB entry
     if (hopsToAdd.size() == 0) {
@@ -132,7 +132,7 @@
       if (isUpdatable) {
         unregisterPrefix(entry.getName(), hop.getConnectingFaceUri());
       }
-      _LOG_DEBUG("Removing " << hop.getConnectingFaceUri() << " from " << entry.getName());
+      NLSR_LOG_DEBUG("Removing " << hop.getConnectingFaceUri() << " from " << entry.getName());
       entry.getNexthopList().removeNextHop(hop);
     }
 
@@ -153,11 +153,11 @@
 void
 Fib::clean()
 {
-  _LOG_DEBUG("Fib::clean called");
+  NLSR_LOG_DEBUG("Fib::clean called");
   for (std::map<ndn::Name, FibEntry>::iterator it = m_table.begin();
        it != m_table.end();
        ++it) {
-    _LOG_DEBUG("Cancelling Scheduled event. Name: " << it->second.getName());
+    NLSR_LOG_DEBUG("Cancelling Scheduled event. Name: " << it->second.getName());
     cancelEntryRefresh(it->second);
     for (std::set<NextHop, NextHopComparator>::iterator nhit =
          (it->second).getNexthopList().getNextHops().begin();
@@ -213,7 +213,7 @@
      .setExpirationPeriod(timeout)
      .setOrigin(ndn::nfd::ROUTE_ORIGIN_NLSR);
 
-    _LOG_DEBUG("Registering prefix: " << faceParameters.getName() << " faceUri: " << faceUri);
+    NLSR_LOG_DEBUG("Registering prefix: " << faceParameters.getName() << " faceUri: " << faceUri);
     m_controller.start<ndn::nfd::RibRegisterCommand>(faceParameters,
                                                    std::bind(&Fib::onRegistrationSuccess, this, _1,
                                                              "Successful in name registration",
@@ -225,7 +225,7 @@
                                                              faceUri, times));
   }
   else {
-    _LOG_WARN("Error: No Face Id for face uri: " << faceUri);
+    NLSR_LOG_WARN("Error: No Face Id for face uri: " << faceUri);
   }
 }
 
@@ -233,7 +233,7 @@
 Fib::onRegistrationSuccess(const ndn::nfd::ControlParameters& commandSuccessResult,
                            const std::string& message, const ndn::util::FaceUri& faceUri)
 {
-  _LOG_DEBUG(message << ": " << commandSuccessResult.getName() <<
+  NLSR_LOG_DEBUG(message << ": " << commandSuccessResult.getName() <<
              " Face Uri: " << faceUri << " faceId: " << commandSuccessResult.getFaceId());
 
   AdjacencyList::iterator adjacent = m_adjacencyList.findAdjacent(faceUri);
@@ -253,17 +253,17 @@
                            const ndn::util::FaceUri& faceUri,
                            uint8_t times)
 {
-  _LOG_DEBUG(message << ": " << response.getText() << " (code: " << response.getCode() << ")");
-  _LOG_DEBUG("Prefix: " << parameters.getName() << " failed for: " << times);
+  NLSR_LOG_DEBUG(message << ": " << response.getText() << " (code: " << response.getCode() << ")");
+  NLSR_LOG_DEBUG("Prefix: " << parameters.getName() << " failed for: " << times);
   if (times < 3) {
-    _LOG_DEBUG("Trying to register again...");
+    NLSR_LOG_DEBUG("Trying to register again...");
     registerPrefix(parameters.getName(), faceUri,
                    parameters.getCost(),
                    parameters.getExpirationPeriod(),
                    parameters.getFlags(), times+1);
   }
   else {
-    _LOG_DEBUG("Registration trial given up");
+    NLSR_LOG_DEBUG("Registration trial given up");
   }
 }
 
@@ -271,7 +271,7 @@
 Fib::unregisterPrefix(const ndn::Name& namePrefix, const std::string& faceUri)
 {
   uint32_t faceId = m_faceMap.getFaceId(faceUri);
-  _LOG_DEBUG("Unregister prefix: " << namePrefix << " Face Uri: " << faceUri);
+  NLSR_LOG_DEBUG("Unregister prefix: " << namePrefix << " Face Uri: " << faceUri);
   if (faceId > 0) {
     ndn::nfd::ControlParameters controlParameters;
     controlParameters
@@ -291,7 +291,7 @@
 Fib::onUnregistrationSuccess(const ndn::nfd::ControlParameters& commandSuccessResult,
                              const std::string& message)
 {
-  _LOG_DEBUG("Unregister successful Prefix: " << commandSuccessResult.getName() <<
+  NLSR_LOG_DEBUG("Unregister successful Prefix: " << commandSuccessResult.getName() <<
              " Face Id: " << commandSuccessResult.getFaceId());
 }
 
@@ -299,7 +299,7 @@
 Fib::onUnregistrationFailure(const ndn::nfd::ControlResponse& response,
                              const std::string& message)
 {
-  _LOG_DEBUG(message << ": " << response.getText() << " (code: " << response.getCode() << ")");
+  NLSR_LOG_DEBUG(message << ": " << response.getText() << " (code: " << response.getCode() << ")");
 }
 
 void
@@ -323,7 +323,7 @@
 Fib::onSetStrategySuccess(const ndn::nfd::ControlParameters& commandSuccessResult,
                          const std::string& message)
 {
-  _LOG_DEBUG(message << ": " << commandSuccessResult.getStrategy() << " "
+  NLSR_LOG_DEBUG(message << ": " << commandSuccessResult.getStrategy() << " "
             << "for name: " << commandSuccessResult.getName());
 }
 
@@ -333,7 +333,7 @@
                           uint32_t count,
                           const std::string& message)
 {
-  _LOG_DEBUG(message << ": " << parameters.getStrategy() << " "
+  NLSR_LOG_DEBUG(message << ": " << parameters.getStrategy() << " "
             << "for name: " << parameters.getName());
   if (count < 3) {
     setStrategy(parameters.getName(), parameters.getStrategy().toUri(),count+1);
@@ -343,7 +343,7 @@
 void
 Fib::scheduleEntryRefresh(FibEntry& entry, const afterRefreshCallback& refreshCallback)
 {
-  _LOG_DEBUG("Scheduling refresh for " << entry.getName()
+  NLSR_LOG_DEBUG("Scheduling refresh for " << entry.getName()
                                        << " Seq Num: " << entry.getSeqNo()
                                        << " in " << m_refreshTime << " seconds");
 
@@ -362,7 +362,7 @@
 void
 Fib::cancelEntryRefresh(const FibEntry& entry)
 {
-  _LOG_DEBUG("Cancelling refresh for " << entry.getName() << " Seq Num: " << entry.getSeqNo());
+  NLSR_LOG_DEBUG("Cancelling refresh for " << entry.getName() << " Seq Num: " << entry.getSeqNo());
 
   m_scheduler.cancelEvent(entry.getRefreshEventId());
   entry.getRefreshEventId().reset();
@@ -378,7 +378,7 @@
   }
 
   FibEntry& entry = it->second;
-  _LOG_DEBUG("Refreshing " << entry.getName() << " Seq Num: " << entry.getSeqNo());
+  NLSR_LOG_DEBUG("Refreshing " << entry.getName() << " Seq Num: " << entry.getSeqNo());
 
   // Increment sequence number
     entry.setSeqNo(entry.getSeqNo() + 1);
@@ -397,7 +397,7 @@
 void
 Fib::writeLog()
 {
-  _LOG_DEBUG("-------------------FIB-----------------------------");
+  NLSR_LOG_DEBUG("-------------------FIB-----------------------------");
   for (std::map<ndn::Name, FibEntry>::iterator it = m_table.begin();
        it != m_table.end();
        ++it) {
diff --git a/src/route/map.cpp b/src/route/map.cpp
index d43e058..82f73b0 100644
--- a/src/route/map.cpp
+++ b/src/route/map.cpp
@@ -83,10 +83,10 @@
 void
 Map::writeLog()
 {
-  _LOG_DEBUG("---------------Map----------------------");
+  NLSR_LOG_DEBUG("---------------Map----------------------");
   auto&& routerNameView = m_entries.get<detail::byRouterName>();
   for (auto entry = routerNameView.begin(); entry != routerNameView.end(); entry++) {
-    _LOG_DEBUG("MapEntry: ( Router: " << entry->getRouter() << " Mapping No: "
+    NLSR_LOG_DEBUG("MapEntry: ( Router: " << entry->getRouter() << " Mapping No: "
                << entry->getMappingNumber() << " )");
   }
 }
diff --git a/src/route/name-prefix-table-entry.cpp b/src/route/name-prefix-table-entry.cpp
index 298a2ef..2403003 100644
--- a/src/route/name-prefix-table-entry.cpp
+++ b/src/route/name-prefix-table-entry.cpp
@@ -55,7 +55,7 @@
     m_rteList.erase(iterator);
   }
   else {
-    _LOG_ERROR("Routing entry for: " << entryPtr->getDestination()
+    NLSR_LOG_ERROR("Routing entry for: " << entryPtr->getDestination()
                << " not found in NPT entry: " << getNamePrefix());
   }
   return entryPtr->getUseCount();
@@ -81,10 +81,10 @@
 void
 NamePrefixTableEntry::writeLog()
 {
-  _LOG_DEBUG("Name: " << m_namePrefix);
+  NLSR_LOG_DEBUG("Name: " << m_namePrefix);
   for (auto it = m_rteList.begin(); it != m_rteList.end(); ++it) {
-    _LOG_DEBUG("Destination: " << (*it)->getDestination());
-    _LOG_DEBUG("Nexthops: ");
+    NLSR_LOG_DEBUG("Destination: " << (*it)->getDestination());
+    NLSR_LOG_DEBUG("Nexthops: ");
     (*it)->getNexthopList().writeLog();
   }
   m_nexthopList.writeLog();
diff --git a/src/route/name-prefix-table.cpp b/src/route/name-prefix-table.cpp
index 52271ef..4496f6c 100644
--- a/src/route/name-prefix-table.cpp
+++ b/src/route/name-prefix-table.cpp
@@ -99,7 +99,7 @@
   std::shared_ptr<NamePrefixTableEntry> npte;
   // Either we have to make a new NPT entry or there already was one.
   if (nameItr == m_table.end()) {
-    _LOG_DEBUG("Adding origin: " << rtpePtr->getDestination()
+    NLSR_LOG_DEBUG("Adding origin: " << rtpePtr->getDestination()
                << " to a new name prefix: " << name);
     npte = make_shared<NamePrefixTableEntry>(name);
     npte->addRoutingTableEntry(rtpePtr);
@@ -107,7 +107,7 @@
     m_table.push_back(npte);
     // If this entry has next hops, we need to inform the FIB
     if (npte->getNexthopList().size() > 0) {
-      _LOG_TRACE("Updating FIB with next hops for " << npte);
+      NLSR_LOG_TRACE("Updating FIB with next hops for " << npte);
       m_nlsr.getFib().update(name, npte->getNexthopList());
     }
     // The routing table may recalculate and add a routing table entry
@@ -117,23 +117,23 @@
     // remain in the Name Prefix Table as a future routing table
     // calculation may add next hops.
     else {
-      _LOG_TRACE(*npte << " has no next hops; removing from FIB");
+      NLSR_LOG_TRACE(*npte << " has no next hops; removing from FIB");
       m_nlsr.getFib().remove(name);
     }
   }
   else {
     npte = *nameItr;
-    _LOG_TRACE("Adding origin: " << rtpePtr->getDestination()
+    NLSR_LOG_TRACE("Adding origin: " << rtpePtr->getDestination()
                << " to existing prefix: " << *nameItr);
     (*nameItr)->addRoutingTableEntry(rtpePtr);
     (*nameItr)->generateNhlfromRteList();
 
     if ((*nameItr)->getNexthopList().size() > 0) {
-      _LOG_TRACE("Updating FIB with next hops for " << (*nameItr));
+      NLSR_LOG_TRACE("Updating FIB with next hops for " << (*nameItr));
       m_nlsr.getFib().update(name, (*nameItr)->getNexthopList());
     }
     else {
-      _LOG_TRACE((*nameItr) << " has no next hops; removing from FIB");
+      NLSR_LOG_TRACE((*nameItr) << " has no next hops; removing from FIB");
       m_nlsr.getFib().remove(name);
     }
   }
@@ -145,7 +145,7 @@
 void
 NamePrefixTable::removeEntry(const ndn::Name& name, const ndn::Name& destRouter)
 {
-  _LOG_DEBUG("Removing origin: " << destRouter << " from " << name);
+  NLSR_LOG_DEBUG("Removing origin: " << destRouter << " from " << name);
 
   // Fetch an iterator to the appropriate pair object in the pool.
   RoutingTableEntryPool::iterator rtpeItr = m_rtpool.find(destRouter);
@@ -153,7 +153,7 @@
   // Simple error checking to prevent any unusual behavior in the case
   // that we try to remove an entry that isn't there.
   if (rtpeItr == m_rtpool.end()) {
-    _LOG_DEBUG("No entry for origin: " << destRouter
+    NLSR_LOG_DEBUG("No entry for origin: " << destRouter
                << " found, so it cannot be removed from prefix: "
                << name);
     return;
@@ -167,7 +167,7 @@
                    return entry->getNamePrefix() == name;
                  });
   if (nameItr != m_table.end()) {
-    _LOG_TRACE("Removing origin: " << rtpePtr->getDestination()
+    NLSR_LOG_TRACE("Removing origin: " << rtpePtr->getDestination()
                << " from prefix: " << **nameItr);
 
     // Rather than iterating through the whole list periodically, just
@@ -192,20 +192,20 @@
     //   new entry for the prefix will be created.
     //
     if ((*nameItr)->getRteListSize() == 0) {
-      _LOG_TRACE(**nameItr << " has no routing table entries;"
+      NLSR_LOG_TRACE(**nameItr << " has no routing table entries;"
                  << " removing from table and FIB");
       m_table.erase(nameItr);
       m_nlsr.getFib().remove(name);
     }
     else {
-      _LOG_TRACE(**nameItr << " has other routing table entries;"
+      NLSR_LOG_TRACE(**nameItr << " has other routing table entries;"
                  << " updating FIB with next hops");
       (*nameItr)->generateNhlfromRteList();
       m_nlsr.getFib().update(name, (*nameItr)->getNexthopList());
     }
   }
   else {
-    _LOG_DEBUG("Attempted to remove origin: " << rtpePtr->getDestination()
+    NLSR_LOG_DEBUG("Attempted to remove origin: " << rtpePtr->getDestination()
                << " from non-existent prefix: " << name);
   }
 }
@@ -213,7 +213,7 @@
 void
 NamePrefixTable::updateWithNewRoute(const std::list<RoutingTableEntry>& entries)
 {
-  _LOG_DEBUG("Updating table with newly calculated routes");
+  NLSR_LOG_DEBUG("Updating table with newly calculated routes");
 
   // Iterate over each pool entry we have
   for (auto&& poolEntryPair : m_rtpool) {
@@ -225,7 +225,7 @@
     // If this pool entry has a corresponding entry in the routing table now
     if (sourceEntry != entries.end()
         && poolEntry->getNexthopList() != sourceEntry->getNexthopList()) {
-      _LOG_DEBUG("Routing entry: " << poolEntry->getDestination() << " has changed next-hops.");
+      NLSR_LOG_DEBUG("Routing entry: " << poolEntry->getDestination() << " has changed next-hops.");
       poolEntry->setNexthopList(sourceEntry->getNexthopList());
       for (const auto& nameEntry : poolEntry->namePrefixTableEntries) {
         auto nameEntryFullPtr = nameEntry.second.lock();
@@ -233,7 +233,7 @@
       }
     }
     else if (sourceEntry == entries.end()) {
-      _LOG_DEBUG("Routing entry: " << poolEntry->getDestination() << " now has no next-hops.");
+      NLSR_LOG_DEBUG("Routing entry: " << poolEntry->getDestination() << " now has no next-hops.");
       poolEntry->getNexthopList().reset();
       for (const auto& nameEntry : poolEntry->namePrefixTableEntries) {
         auto nameEntryFullPtr = nameEntry.second.lock();
@@ -241,7 +241,7 @@
       }
     }
     else {
-      _LOG_TRACE("No change in routing entry:" << poolEntry->getDestination()
+      NLSR_LOG_TRACE("No change in routing entry:" << poolEntry->getDestination()
                  << ", no action necessary.");
     }
   }
@@ -271,7 +271,7 @@
 NamePrefixTable::deleteRtpeFromPool(std::shared_ptr<RoutingTablePoolEntry> rtpePtr)
 {
   if (m_rtpool.erase(rtpePtr->getDestination()) != 1) {
-    _LOG_DEBUG("Attempted to delete non-existent origin: "
+    NLSR_LOG_DEBUG("Attempted to delete non-existent origin: "
                << rtpePtr->getDestination()
                << " from NPT routing table entry storage pool.");
   }
@@ -280,7 +280,7 @@
 void
 NamePrefixTable::writeLog()
 {
-  _LOG_DEBUG(*this);
+  NLSR_LOG_DEBUG(*this);
 }
 
 std::ostream&
diff --git a/src/route/nexthop-list.cpp b/src/route/nexthop-list.cpp
index 65f6782..a0a585a 100644
--- a/src/route/nexthop-list.cpp
+++ b/src/route/nexthop-list.cpp
@@ -113,7 +113,7 @@
 
   for (std::set<NextHop, NextHopComparator>::iterator it = m_nexthopList.begin();
        it != m_nexthopList.end() ; it++, i++) {
-    _LOG_DEBUG("Nexthop " << i << ": " << (*it).getConnectingFaceUri()
+    NLSR_LOG_DEBUG("Nexthop " << i << ": " << (*it).getConnectingFaceUri()
                << " Route Cost: " << (*it).getRouteCost());
   }
 }
diff --git a/src/route/routing-table-calculator.cpp b/src/route/routing-table-calculator.cpp
index c5f8e09..c7b7d08 100644
--- a/src/route/routing-table-calculator.cpp
+++ b/src/route/routing-table-calculator.cpp
@@ -104,7 +104,7 @@
           correctedCost = std::max(toCost, fromCost);
         }
 
-        _LOG_WARN("Cost between [" << row << "][" << col << "] and [" << col << "][" << row <<
+        NLSR_LOG_WARN("Cost between [" << row << "][" << col << "] and [" << col << "][" << row <<
                   "] are not the same (" << toCost << " != " << fromCost << "). " <<
                   "Correcting to cost: " << correctedCost);
 
@@ -124,7 +124,7 @@
       line += boost::lexical_cast<std::string>(adjMatrix[i][j]);
       line += " ";
     }
-    _LOG_DEBUG(line);
+    NLSR_LOG_DEBUG(line);
   }
 }
 
@@ -206,7 +206,7 @@
 LinkStateRoutingTableCalculator::calculatePath(Map& pMap,
                                                RoutingTable& rt, Nlsr& pnlsr)
 {
-  _LOG_DEBUG("LinkStateRoutingTableCalculator::calculatePath Called");
+  NLSR_LOG_DEBUG("LinkStateRoutingTableCalculator::calculatePath Called");
   allocateAdjMatrix();
   initMatrix();
   makeAdjMatrix(pnlsr, pMap);
@@ -300,7 +300,7 @@
 LinkStateRoutingTableCalculator::addAllLsNextHopsToRoutingTable(Nlsr& pnlsr, RoutingTable& rt,
                                                                 Map& pMap, uint32_t sourceRouter)
 {
-  _LOG_DEBUG("LinkStateRoutingTableCalculator::addAllNextHopsToRoutingTable Called");
+  NLSR_LOG_DEBUG("LinkStateRoutingTableCalculator::addAllNextHopsToRoutingTable Called");
 
   int nextHopRouter = 0;
 
@@ -407,7 +407,7 @@
 HyperbolicRoutingCalculator::calculatePaths(Map& map, RoutingTable& rt,
                                             Lsdb& lsdb, AdjacencyList& adjacencies)
 {
-  _LOG_TRACE("Calculating hyperbolic paths");
+  NLSR_LOG_TRACE("Calculating hyperbolic paths");
 
   ndn::optional<int32_t> thisRouter = map.getMappingNoByRouterName(m_thisRouterName);
 
@@ -417,7 +417,7 @@
 
     // Don't calculate nexthops using an inactive router
     if (adj->getStatus() == Adjacent::STATUS_INACTIVE) {
-      _LOG_TRACE(adj->getName() << " is inactive; not using it as a nexthop");
+      NLSR_LOG_TRACE(adj->getName() << " is inactive; not using it as a nexthop");
       continue;
     }
 
@@ -436,7 +436,7 @@
     ndn::optional<int32_t> src = map.getMappingNoByRouterName(srcRouterName);
 
     if (!src) {
-      _LOG_WARN(adj->getName() << " does not exist in the router map!");
+      NLSR_LOG_WARN(adj->getName() << " does not exist in the router map!");
       continue;
     }
 
@@ -451,7 +451,7 @@
 
           // Could not compute distance
           if (distance == UNKNOWN_DISTANCE) {
-            _LOG_WARN("Could not calculate hyperbolic distance from " << srcRouterName << " to " <<
+            NLSR_LOG_WARN("Could not calculate hyperbolic distance from " << srcRouterName << " to " <<
                       *destRouterName);
             continue;
           }
@@ -467,7 +467,7 @@
 HyperbolicRoutingCalculator::getHyperbolicDistance(Map& map, Lsdb& lsdb,
                                                    ndn::Name src, ndn::Name dest)
 {
-  _LOG_TRACE("Calculating hyperbolic distance from " << src << " to " << dest);
+  NLSR_LOG_TRACE("Calculating hyperbolic distance from " << src << " to " << dest);
 
   double distance = UNKNOWN_DISTANCE;
 
@@ -502,7 +502,7 @@
   // double r_i, double r_j, double delta_theta, double zeta = 1 (default)
   distance = calculateHyperbolicDistance(srcRadius, destRadius, diffTheta);
 
-  _LOG_TRACE("Distance from " << src << " to " << dest << " is " << distance);
+  NLSR_LOG_TRACE("Distance from " << src << " to " << dest << " is " << distance);
 
   return distance;
 }
@@ -517,7 +517,7 @@
 
   // Check if two vector lengths are the same
   if (angleVectorI.size() != angleVectorJ.size()) {
-    _LOG_ERROR("Angle vector sizes do not match");
+    NLSR_LOG_ERROR("Angle vector sizes do not match");
     return UNKNOWN_DISTANCE;
   }
 
@@ -526,20 +526,20 @@
     for (unsigned int k = 0; k < angleVectorI.size() - 1; k++) {
       if ((angleVectorI[k] > M_PI && angleVectorI[k] < 0.0) ||
           (angleVectorJ[k] > M_PI && angleVectorJ[k] < 0.0)) {
-        _LOG_ERROR("Angle outside [0, PI]");
+        NLSR_LOG_ERROR("Angle outside [0, PI]");
         return UNKNOWN_DISTANCE;
       }
     }
   }
   if (angleVectorI[angleVectorI.size()-1] > 2.*M_PI ||
       angleVectorI[angleVectorI.size()-1] < 0.0) {
-    _LOG_ERROR("Angle not within [0, 2PI]");
+    NLSR_LOG_ERROR("Angle not within [0, 2PI]");
     return UNKNOWN_DISTANCE;
   }
 
   if (angleVectorI[angleVectorI.size()-1] > 2.*M_PI ||
       angleVectorI[angleVectorI.size()-1] < 0.0) {
-    _LOG_ERROR("Angle not within [0, 2PI]");
+    NLSR_LOG_ERROR("Angle not within [0, 2PI]");
     return UNKNOWN_DISTANCE;
   }
 
@@ -593,7 +593,7 @@
   double zeta = 1;
 
   if (deltaTheta <= 0.0 || rI <= 0.0 || rJ <= 0.0) {
-    _LOG_ERROR("Delta theta or rI or rJ is <= 0");
+    NLSR_LOG_ERROR("Delta theta or rI or rJ is <= 0");
     return UNKNOWN_DISTANCE;
   }
 
@@ -609,7 +609,7 @@
   NextHop hop(faceUri, cost);
   hop.setHyperbolic(true);
 
-  _LOG_TRACE("Calculated " << hop << " for destination: " << dest);
+  NLSR_LOG_TRACE("Calculated " << hop << " for destination: " << dest);
 
   if (m_isDryRun) {
     rt.addNextHopToDryTable(dest, hop);
diff --git a/src/route/routing-table.cpp b/src/route/routing-table.cpp
index a414e8a..81fb9cb 100644
--- a/src/route/routing-table.cpp
+++ b/src/route/routing-table.cpp
@@ -67,12 +67,12 @@
          .doesLsaExist(ndn::Name{pnlsr.getConfParameter().getRouterPrefix()}
                        .append(std::to_string(Lsa::Type::COORDINATE)), Lsa::Type::COORDINATE))) {
       if (pnlsr.getIsBuildAdjLsaSheduled() != 1) {
-        _LOG_TRACE("Clearing old routing table");
+        NLSR_LOG_TRACE("Clearing old routing table");
         clearRoutingTable();
         // for dry run options
         clearDryRoutingTable();
 
-        _LOG_DEBUG("Calculating routing table");
+        NLSR_LOG_DEBUG("Calculating routing table");
 
         // calculate Link State routing
         if ((pnlsr.getConfParameter().getHyperbolicState() == HYPERBOLIC_STATE_OFF)
@@ -88,24 +88,24 @@
           calculateHypDryRoutingTable(pnlsr);
         }
         // Inform the NPT that updates have been made
-        _LOG_DEBUG("Calling Update NPT With new Route");
+        NLSR_LOG_DEBUG("Calling Update NPT With new Route");
         (*afterRoutingChange)(m_rTable);
         writeLog(pnlsr.getConfParameter().getHyperbolicState());
         pnlsr.getNamePrefixTable().writeLog();
         pnlsr.getFib().writeLog();
       }
       else {
-        _LOG_DEBUG("Adjacency building is scheduled, so"
+        NLSR_LOG_DEBUG("Adjacency building is scheduled, so"
                    " routing table can not be calculated :(");
       }
     }
     else {
-      _LOG_DEBUG("No Adj LSA of router itself,"
+      NLSR_LOG_DEBUG("No Adj LSA of router itself,"
                  " so Routing table can not be calculated :(");
       clearRoutingTable();
       clearDryRoutingTable(); // for dry run options
       // need to update NPT here
-      _LOG_DEBUG("Calling Update NPT With new Route");
+      NLSR_LOG_DEBUG("Calling Update NPT With new Route");
       (*afterRoutingChange)(m_rTable);
       writeLog(pnlsr.getConfParameter().getHyperbolicState());
       pnlsr.getNamePrefixTable().writeLog();
@@ -123,7 +123,7 @@
 void
 RoutingTable::calculateLsRoutingTable(Nlsr& nlsr)
 {
-  _LOG_DEBUG("RoutingTable::calculateLsRoutingTable Called");
+  NLSR_LOG_DEBUG("RoutingTable::calculateLsRoutingTable Called");
 
   Map map;
   map.createFromAdjLsdb(nlsr.getLsdb().getAdjLsdb().begin(), nlsr.getLsdb().getAdjLsdb().end());
@@ -173,7 +173,7 @@
 RoutingTable::scheduleRoutingTableCalculation(Nlsr& pnlsr)
 {
   if (pnlsr.getIsRouteCalculationScheduled() != true) {
-    _LOG_DEBUG("Scheduling routing table calculation in " << m_routingCalcInterval);
+    NLSR_LOG_DEBUG("Scheduling routing table calculation in " << m_routingCalcInterval);
 
     m_scheduler.scheduleEvent(m_routingCalcInterval,
                               std::bind(&RoutingTable::calculate, this, std::ref(pnlsr)));
@@ -191,7 +191,7 @@
 void
 RoutingTable::addNextHop(const ndn::Name& destRouter, NextHop& nh)
 {
-  _LOG_DEBUG("Adding " << nh << " for destination: " << destRouter);
+  NLSR_LOG_DEBUG("Adding " << nh << " for destination: " << destRouter);
 
   RoutingTableEntry* rteChk = findRoutingTableEntry(destRouter);
   if (rteChk == 0) {
@@ -220,20 +220,20 @@
 void
 RoutingTable::writeLog(int hyperbolicState)
 {
-  _LOG_DEBUG("---------------Routing Table------------------");
+  NLSR_LOG_DEBUG("---------------Routing Table------------------");
   for (std::list<RoutingTableEntry>::iterator it = m_rTable.begin() ;
        it != m_rTable.end(); ++it) {
-    _LOG_DEBUG("Destination: " << (*it).getDestination());
-    _LOG_DEBUG("Nexthops: ");
+    NLSR_LOG_DEBUG("Destination: " << (*it).getDestination());
+    NLSR_LOG_DEBUG("Nexthops: ");
     (*it).getNexthopList().writeLog();
   }
 
   if (hyperbolicState == HYPERBOLIC_STATE_DRY_RUN) {
-    _LOG_DEBUG("--------Hyperbolic Routing Table(Dry)---------");
+    NLSR_LOG_DEBUG("--------Hyperbolic Routing Table(Dry)---------");
     for (std::list<RoutingTableEntry>::iterator it = m_dryTable.begin() ;
         it != m_dryTable.end(); ++it) {
-      _LOG_DEBUG("Destination: " << (*it).getDestination());
-      _LOG_DEBUG("Nexthops: ");
+      NLSR_LOG_DEBUG("Destination: " << (*it).getDestination());
+      NLSR_LOG_DEBUG("Nexthops: ");
       (*it).getNexthopList().writeLog();
     }
   }
@@ -242,7 +242,7 @@
 void
 RoutingTable::addNextHopToDryTable(const ndn::Name& destRouter, NextHop& nh)
 {
-  _LOG_DEBUG("Adding " << nh << " to dry table for destination: " << destRouter);
+  NLSR_LOG_DEBUG("Adding " << nh << " to dry table for destination: " << destRouter);
 
   std::list<RoutingTableEntry>::iterator it = std::find_if(m_dryTable.begin(),
                                                            m_dryTable.end(),
