diff --git a/src/adjacency-list.cpp b/src/adjacency-list.cpp
index 5666ed0..33626f5 100644
--- a/src/adjacency-list.cpp
+++ b/src/adjacency-list.cpp
@@ -291,7 +291,7 @@
 void
 AdjacencyList::writeLog()
 {
-  _LOG_DEBUG("-------Adjacency List--------");
+  NLSR_LOG_DEBUG("-------Adjacency List--------");
   for (std::list<Adjacent>::iterator it = m_adjList.begin();
        it != m_adjList.end(); it++) {
     (*it).writeLog();
diff --git a/src/adjacent.cpp b/src/adjacent.cpp
index 7109f21..913bbbd 100644
--- a/src/adjacent.cpp
+++ b/src/adjacent.cpp
@@ -91,7 +91,7 @@
 void
 Adjacent::writeLog()
 {
-  _LOG_DEBUG(*this);
+  NLSR_LOG_DEBUG(*this);
 }
 
 } // namespace nlsr
diff --git a/src/communication/sync-logic-handler.cpp b/src/communication/sync-logic-handler.cpp
index d87f4fc..ec8dca5 100644
--- a/src/communication/sync-logic-handler.cpp
+++ b/src/communication/sync-logic-handler.cpp
@@ -55,7 +55,7 @@
 SyncLogicHandler::createSyncSocket(const ndn::Name& syncPrefix)
 {
   if (m_syncSocket != nullptr) {
-    _LOG_WARN("Trying to create Sync socket, but Sync socket already exists");
+    NLSR_LOG_WARN("Trying to create Sync socket, but Sync socket already exists");
     return;
   }
 
@@ -64,7 +64,7 @@
   // Build LSA sync update prefix
   buildUpdatePrefix();
 
-  _LOG_DEBUG("Creating Sync socket. Sync Prefix: " << m_syncPrefix);
+  NLSR_LOG_DEBUG("Creating Sync socket. Sync Prefix: " << m_syncPrefix);
 
   // The face's lifetime is managed in main.cpp; SyncSocket should not manage the memory
   // of the object
@@ -84,18 +84,18 @@
 void
 SyncLogicHandler::onChronoSyncUpdate(const std::vector<chronosync::MissingDataInfo>& v)
 {
-  _LOG_DEBUG("Received ChronoSync update event");
+  NLSR_LOG_DEBUG("Received ChronoSync update event");
 
   for (size_t i = 0; i < v.size(); i++){
     ndn::Name updateName = v[i].session.getPrefix(-1);
 
-    _LOG_DEBUG("Update Name: " << updateName << " Seq no: " << v[i].high);
+    NLSR_LOG_DEBUG("Update Name: " << updateName << " Seq no: " << v[i].high);
 
     int32_t nlsrPosition = util::getNameComponentPosition(updateName, nlsr::NLSR_COMPONENT);
     int32_t lsaPosition = util::getNameComponentPosition(updateName, nlsr::LSA_COMPONENT);
 
     if (nlsrPosition < 0 || lsaPosition < 0) {
-      _LOG_WARN("Received malformed sync update");
+      NLSR_LOG_WARN("Received malformed sync update");
       return;
     }
 
@@ -113,7 +113,7 @@
 SyncLogicHandler::processUpdateFromSync(const ndn::Name& originRouter,
                                         const ndn::Name& updateName, const uint64_t& seqNo)
 {
-  _LOG_DEBUG("Origin Router of update: " << originRouter);
+  NLSR_LOG_DEBUG("Origin Router of update: " << originRouter);
 
   // A router should not try to fetch its own LSA
   if (originRouter != m_confParam.getRouterPrefix()) {
@@ -121,20 +121,20 @@
     Lsa::Type lsaType;
     std::istringstream(updateName.get(updateName.size()-1).toUri()) >> lsaType;
 
-    _LOG_DEBUG("Received sync update with higher " << lsaType
+    NLSR_LOG_DEBUG("Received sync update with higher " << lsaType
                << " sequence number than entry in LSDB");
 
     if (m_isLsaNew(originRouter, lsaType, seqNo)) {
       if (lsaType == Lsa::Type::ADJACENCY && seqNo != 0 &&
           m_confParam.getHyperbolicState() == HYPERBOLIC_STATE_ON) {
-        _LOG_ERROR("Got an update for adjacency LSA when hyperbolic routing"
+        NLSR_LOG_ERROR("Got an update for adjacency LSA when hyperbolic routing"
                    << " is enabled. Not going to fetch.");
         return;
       }
 
       if (lsaType == Lsa::Type::COORDINATE && seqNo != 0 &&
           m_confParam.getHyperbolicState() == HYPERBOLIC_STATE_OFF) {
-        _LOG_ERROR("Got an update for coordinate LSA when link-state"
+        NLSR_LOG_ERROR("Got an update for coordinate LSA when link-state"
                    << " is enabled. Not going to fetch.");
         return;
       }
@@ -147,7 +147,7 @@
 SyncLogicHandler::publishRoutingUpdate(const Lsa::Type& type, const uint64_t& seqNo)
 {
   if (m_syncSocket == nullptr) {
-    _LOG_FATAL("Cannot publish routing update; SyncSocket does not exist");
+    NLSR_LOG_FATAL("Cannot publish routing update; SyncSocket does not exist");
 
     BOOST_THROW_EXCEPTION(SyncLogicHandler::Error("Cannot publish routing update; SyncSocket does not exist"));
   }
@@ -188,7 +188,7 @@
 void
 SyncLogicHandler::publishSyncUpdate(const ndn::Name& updatePrefix, uint64_t seqNo)
 {
-  _LOG_DEBUG("Publishing Sync Update. Prefix: " << updatePrefix << " Seq No: " << seqNo);
+  NLSR_LOG_DEBUG("Publishing Sync Update. Prefix: " << updatePrefix << " Seq No: " << seqNo);
 
   ndn::Name updateName(updatePrefix);
   std::string data("NoData");
diff --git a/src/conf-parameter.cpp b/src/conf-parameter.cpp
index e19fe5e..05a96dd 100644
--- a/src/conf-parameter.cpp
+++ b/src/conf-parameter.cpp
@@ -31,33 +31,33 @@
 void
 ConfParameter::writeLog()
 {
-  _LOG_INFO("Router Name: " << m_routerName);
-  _LOG_INFO("Site Name: " << m_siteName);
-  _LOG_INFO("Network: " << m_network);
-  _LOG_INFO("Router Prefix: " << m_routerPrefix);
-  _LOG_INFO("ChronoSync sync Prefix: " << m_chronosyncPrefix);
-  _LOG_INFO("ChronoSync LSA prefix: " << m_lsaPrefix);
-  _LOG_INFO("Hello Interest retry number: " << m_interestRetryNumber);
-  _LOG_INFO("Hello Interest resend second: " << m_interestResendTime);
-  _LOG_INFO("Info Interest interval: " << m_infoInterestInterval);
-  _LOG_INFO("LSA refresh time: " << m_lsaRefreshTime);
-  _LOG_INFO("FIB Entry refresh time: " << m_lsaRefreshTime * 2);
-  _LOG_INFO("LSA Interest lifetime: " << getLsaInterestLifetime());
-  _LOG_INFO("Router dead interval: " << getRouterDeadInterval());
-  _LOG_INFO("Max Faces Per Prefix: " << m_maxFacesPerPrefix);
-  _LOG_INFO("Hyperbolic Routing: " << m_hyperbolicState);
-  _LOG_INFO("Hyp R: " << m_corR);
+  NLSR_LOG_INFO("Router Name: " << m_routerName);
+  NLSR_LOG_INFO("Site Name: " << m_siteName);
+  NLSR_LOG_INFO("Network: " << m_network);
+  NLSR_LOG_INFO("Router Prefix: " << m_routerPrefix);
+  NLSR_LOG_INFO("ChronoSync sync Prefix: " << m_chronosyncPrefix);
+  NLSR_LOG_INFO("ChronoSync LSA prefix: " << m_lsaPrefix);
+  NLSR_LOG_INFO("Hello Interest retry number: " << m_interestRetryNumber);
+  NLSR_LOG_INFO("Hello Interest resend second: " << m_interestResendTime);
+  NLSR_LOG_INFO("Info Interest interval: " << m_infoInterestInterval);
+  NLSR_LOG_INFO("LSA refresh time: " << m_lsaRefreshTime);
+  NLSR_LOG_INFO("FIB Entry refresh time: " << m_lsaRefreshTime * 2);
+  NLSR_LOG_INFO("LSA Interest lifetime: " << getLsaInterestLifetime());
+  NLSR_LOG_INFO("Router dead interval: " << getRouterDeadInterval());
+  NLSR_LOG_INFO("Max Faces Per Prefix: " << m_maxFacesPerPrefix);
+  NLSR_LOG_INFO("Hyperbolic Routing: " << m_hyperbolicState);
+  NLSR_LOG_INFO("Hyp R: " << m_corR);
   int i=0;
   for (auto const& value: m_corTheta) {
-    _LOG_INFO("Hyp Angle " << i++ << ": "<< value);
+    NLSR_LOG_INFO("Hyp Angle " << i++ << ": "<< value);
   }
-  _LOG_INFO("Log Directory: " << m_logDir);
-  _LOG_INFO("Seq Directory: " << m_seqFileDir);
+  NLSR_LOG_INFO("Log Directory: " << m_logDir);
+  NLSR_LOG_INFO("Seq Directory: " << m_seqFileDir);
 
   // Event Intervals
-  _LOG_INFO("Adjacency LSA build interval:  " << m_adjLsaBuildInterval);
-  _LOG_INFO("First Hello Interest interval: " << m_firstHelloInterval);
-  _LOG_INFO("Routing calculation interval:  " << m_routingCalcInterval);
+  NLSR_LOG_INFO("Adjacency LSA build interval:  " << m_adjLsaBuildInterval);
+  NLSR_LOG_INFO("First Hello Interest interval: " << m_firstHelloInterval);
+  NLSR_LOG_INFO("Routing calculation interval:  " << m_routingCalcInterval);
 }
 
 } // namespace nlsr
diff --git a/src/hello-protocol.cpp b/src/hello-protocol.cpp
index 4a3d06b..b28620b 100644
--- a/src/hello-protocol.cpp
+++ b/src/hello-protocol.cpp
@@ -41,7 +41,7 @@
 void
 HelloProtocol::expressInterest(const ndn::Name& interestName, uint32_t seconds)
 {
-  _LOG_DEBUG("Expressing Interest :" << interestName);
+  NLSR_LOG_DEBUG("Expressing Interest :" << interestName);
   ndn::Interest i(interestName);
   i.setInterestLifetime(ndn::time::seconds(seconds));
   i.setMustBeFresh(true);
@@ -73,7 +73,7 @@
       interestName.append(m_nlsr.getConfParameter().getRouterPrefix().wireEncode());
       expressInterest(interestName,
                       m_nlsr.getConfParameter().getInterestResendTime());
-      _LOG_DEBUG("Sending scheduled interest: " << interestName);
+      NLSR_LOG_DEBUG("Sending scheduled interest: " << interestName);
     }
   }
   scheduleInterest(m_nlsr.getConfParameter().getInfoInterestInterval());
@@ -82,7 +82,7 @@
 void
 HelloProtocol::scheduleInterest(uint32_t seconds)
 {
-  _LOG_DEBUG("Scheduling HELLO Interests in " << ndn::time::seconds(seconds));
+  NLSR_LOG_DEBUG("Scheduling HELLO Interests in " << ndn::time::seconds(seconds));
 
   m_scheduler.scheduleEvent(ndn::time::seconds(seconds),
                             std::bind(&HelloProtocol::sendScheduledInterest, this, seconds));
@@ -98,16 +98,16 @@
   // increment RCV_HELLO_INTEREST
   hpIncrementSignal(Statistics::PacketType::RCV_HELLO_INTEREST);
 
-  _LOG_DEBUG("Interest Received for Name: " << interestName);
+  NLSR_LOG_DEBUG("Interest Received for Name: " << interestName);
   if (interestName.get(-2).toUri() != INFO_COMPONENT) {
-    _LOG_DEBUG("INFO_COMPONENT not found or interestName: " << interestName
+    NLSR_LOG_DEBUG("INFO_COMPONENT not found or interestName: " << interestName
                << " does not match expression");
     return;
   }
 
   ndn::Name neighbor;
   neighbor.wireDecode(interestName.get(-1).blockFromValue());
-  _LOG_DEBUG("Neighbor: " << neighbor);
+  NLSR_LOG_DEBUG("Neighbor: " << neighbor);
   if (m_nlsr.getAdjacencyList().isNeighbor(neighbor)) {
     std::shared_ptr<ndn::Data> data = std::make_shared<ndn::Data>();
     data->setName(ndn::Name(interest.getName()).appendVersion());
@@ -115,7 +115,7 @@
     data->setContent(reinterpret_cast<const uint8_t*>(INFO_COMPONENT.c_str()),
                     INFO_COMPONENT.size());
     m_nlsr.getKeyChain().sign(*data, m_nlsr.getDefaultCertName());
-    _LOG_DEBUG("Sending out data for name: " << interest.getName());
+    NLSR_LOG_DEBUG("Sending out data for name: " << interest.getName());
     m_nlsr.getNlsrFace().put(*data);
     // increment SENT_HELLO_DATA
     hpIncrementSignal(Statistics::PacketType::SENT_HELLO_DATA);
@@ -142,27 +142,27 @@
 {
   // interest name: /<neighbor>/NLSR/INFO/<router>
   const ndn::Name interestName(interest.getName());
-  _LOG_DEBUG("Interest timed out for Name: " << interestName);
+  NLSR_LOG_DEBUG("Interest timed out for Name: " << interestName);
   if (interestName.get(-2).toUri() != INFO_COMPONENT) {
     return;
   }
   ndn::Name neighbor = interestName.getPrefix(-3);
-  _LOG_DEBUG("Neighbor: " << neighbor);
+  NLSR_LOG_DEBUG("Neighbor: " << neighbor);
   m_nlsr.getAdjacencyList().incrementTimedOutInterestCount(neighbor);
 
   Adjacent::Status status = m_nlsr.getAdjacencyList().getStatusOfNeighbor(neighbor);
 
   uint32_t infoIntTimedOutCount =
     m_nlsr.getAdjacencyList().getTimedOutInterestCount(neighbor);
-  _LOG_DEBUG("Status: " << status);
-  _LOG_DEBUG("Info Interest Timed out: " << infoIntTimedOutCount);
+  NLSR_LOG_DEBUG("Status: " << status);
+  NLSR_LOG_DEBUG("Info Interest Timed out: " << infoIntTimedOutCount);
   if (infoIntTimedOutCount < m_nlsr.getConfParameter().getInterestRetryNumber()) {
     // interest name: /<neighbor>/NLSR/INFO/<router>
     ndn::Name interestName(neighbor);
     interestName.append(NLSR_COMPONENT);
     interestName.append(INFO_COMPONENT);
     interestName.append(m_nlsr.getConfParameter().getRouterPrefix().wireEncode());
-    _LOG_DEBUG("Resending interest: " << interestName);
+    NLSR_LOG_DEBUG("Resending interest: " << interestName);
     expressInterest(interestName,
                     m_nlsr.getConfParameter().getInterestResendTime());
   }
@@ -170,7 +170,7 @@
            (infoIntTimedOutCount == m_nlsr.getConfParameter().getInterestRetryNumber())) {
     m_nlsr.getAdjacencyList().setStatusOfNeighbor(neighbor, Adjacent::STATUS_INACTIVE);
 
-    _LOG_DEBUG("Neighbor: " << neighbor << " status changed to INACTIVE");
+    NLSR_LOG_DEBUG("Neighbor: " << neighbor << " status changed to INACTIVE");
 
     m_nlsr.getLsdb().scheduleAdjLsaBuild();
   }
@@ -182,10 +182,10 @@
 void
 HelloProtocol::onContent(const ndn::Interest& interest, const ndn::Data& data)
 {
-  _LOG_DEBUG("Received data for INFO(name): " << data.getName());
+  NLSR_LOG_DEBUG("Received data for INFO(name): " << data.getName());
   if (data.getSignature().hasKeyLocator()) {
     if (data.getSignature().getKeyLocator().getType() == ndn::KeyLocator::KeyLocator_Name) {
-      _LOG_DEBUG("Data signed with: " << data.getSignature().getKeyLocator().getName());
+      NLSR_LOG_DEBUG("Data signed with: " << data.getSignature().getKeyLocator().getName());
     }
   }
   m_nlsr.getValidator().validate(data,
@@ -199,7 +199,7 @@
 {
   // data name: /<neighbor>/NLSR/INFO/<router>/<version>
   ndn::Name dataName = data->getName();
-  _LOG_DEBUG("Data validation successful for INFO(name): " << dataName);
+  NLSR_LOG_DEBUG("Data validation successful for INFO(name): " << dataName);
   if (dataName.get(-3).toUri() == INFO_COMPONENT) {
     ndn::Name neighbor = dataName.getPrefix(-4);
 
@@ -208,8 +208,8 @@
     m_nlsr.getAdjacencyList().setTimedOutInterestCount(neighbor, 0);
     Adjacent::Status newStatus = m_nlsr.getAdjacencyList().getStatusOfNeighbor(neighbor);
 
-    _LOG_DEBUG("Neighbor : " << neighbor);
-    _LOG_DEBUG("Old Status: " << oldStatus << " New Status: " << newStatus);
+    NLSR_LOG_DEBUG("Neighbor : " << neighbor);
+    NLSR_LOG_DEBUG("Old Status: " << oldStatus << " New Status: " << newStatus);
     // change in Adjacency list
     if ((oldStatus - newStatus) != 0) {
       if (m_nlsr.getConfParameter().getHyperbolicState() == HYPERBOLIC_STATE_ON) {
@@ -228,7 +228,7 @@
 HelloProtocol::onContentValidationFailed(const std::shared_ptr<const ndn::Data>& data,
                                          const std::string& msg)
 {
-  _LOG_DEBUG("Validation Error: " << msg);
+  NLSR_LOG_DEBUG("Validation Error: " << msg);
 }
 
 } // namespace nlsr
diff --git a/src/logger.hpp b/src/logger.hpp
index d75687c..2236266 100644
--- a/src/logger.hpp
+++ b/src/logger.hpp
@@ -35,22 +35,22 @@
 #define INIT_LOGGER(name) \
   static log4cxx::LoggerPtr staticModuleLogger = log4cxx::Logger::getLogger(name)
 
-#define _LOG_TRACE(x) \
+#define NLSR_LOG_TRACE(x) \
   LOG4CXX_TRACE(staticModuleLogger, x)
 
-#define _LOG_DEBUG(x) \
+#define NLSR_LOG_DEBUG(x) \
   LOG4CXX_DEBUG(staticModuleLogger, x)
 
-#define _LOG_INFO(x) \
+#define NLSR_LOG_INFO(x) \
   LOG4CXX_INFO(staticModuleLogger, x)
 
-#define _LOG_WARN(x) \
+#define NLSR_LOG_WARN(x) \
   LOG4CXX_WARN(staticModuleLogger, x)
 
-#define _LOG_ERROR(x) \
+#define NLSR_LOG_ERROR(x) \
   LOG4CXX_ERROR(staticModuleLogger, x)
 
-#define _LOG_FATAL(x) \
+#define NLSR_LOG_FATAL(x) \
   LOG4CXX_FATAL(staticModuleLogger, x);
 
 void
diff --git a/src/lsa.cpp b/src/lsa.cpp
index 16616c7..45cd33e 100644
--- a/src/lsa.cpp
+++ b/src/lsa.cpp
@@ -108,7 +108,7 @@
     }
   }
   catch (const std::exception& e) {
-    _LOG_ERROR("Could not deserialize from content: " << e.what());
+    NLSR_LOG_ERROR("Could not deserialize from content: " << e.what());
     return false;
   }
   return true;
@@ -123,19 +123,19 @@
 void
 NameLsa::writeLog()
 {
-  _LOG_DEBUG("Name Lsa: ");
-  _LOG_DEBUG("  Origination Router: " << m_origRouter);
-  _LOG_DEBUG("  Ls Type: " << getType());
-  _LOG_DEBUG("  Ls Seq No: " << m_lsSeqNo);
-  _LOG_DEBUG("  Ls Lifetime: " << m_expirationTimePoint);
-  _LOG_DEBUG("  Names: ");
+  NLSR_LOG_DEBUG("Name Lsa: ");
+  NLSR_LOG_DEBUG("  Origination Router: " << m_origRouter);
+  NLSR_LOG_DEBUG("  Ls Type: " << getType());
+  NLSR_LOG_DEBUG("  Ls Seq No: " << m_lsSeqNo);
+  NLSR_LOG_DEBUG("  Ls Lifetime: " << m_expirationTimePoint);
+  NLSR_LOG_DEBUG("  Names: ");
   int i = 1;
   std::list<ndn::Name> nl = m_npl.getNames();
   for (std::list<ndn::Name>::iterator it = nl.begin(); it != nl.end(); it++)
   {
-    _LOG_DEBUG("    Name " << i << ": " << (*it));
+    NLSR_LOG_DEBUG("    Name " << i << ": " << (*it));
   }
-  _LOG_DEBUG("name_lsa_end");
+  NLSR_LOG_DEBUG("name_lsa_end");
 }
 
 CoordinateLsa::CoordinateLsa(const ndn::Name& origR, uint32_t lsn,
@@ -196,7 +196,7 @@
     }
   }
   catch (const std::exception& e) {
-    _LOG_ERROR("Could not deserialize from content: " << e.what());
+    NLSR_LOG_ERROR("Could not deserialize from content: " << e.what());
     return false;
   }
   return true;
@@ -205,15 +205,15 @@
 void
 CoordinateLsa::writeLog()
 {
-  _LOG_DEBUG("Cor Lsa: ");
-  _LOG_DEBUG("  Origination Router: " << m_origRouter);
-  _LOG_DEBUG("  Ls Type: " << getType());
-  _LOG_DEBUG("  Ls Seq No: " << m_lsSeqNo);
-  _LOG_DEBUG("  Ls Lifetime: " << m_expirationTimePoint);
-  _LOG_DEBUG("    Hyperbolic Radius: " << m_corRad);
+  NLSR_LOG_DEBUG("Cor Lsa: ");
+  NLSR_LOG_DEBUG("  Origination Router: " << m_origRouter);
+  NLSR_LOG_DEBUG("  Ls Type: " << getType());
+  NLSR_LOG_DEBUG("  Ls Seq No: " << m_lsSeqNo);
+  NLSR_LOG_DEBUG("  Ls Lifetime: " << m_expirationTimePoint);
+  NLSR_LOG_DEBUG("    Hyperbolic Radius: " << m_corRad);
   int i = 0;
   for(auto const& value: m_angles) {
-    _LOG_DEBUG("    Hyperbolic Theta " << i++ << ": "<< value);
+    NLSR_LOG_DEBUG("    Hyperbolic Theta " << i++ << ": "<< value);
   }
 }
 
@@ -275,7 +275,7 @@
     }
   }
   catch (const std::exception& e) {
-    _LOG_ERROR("Could not deserialize from content: " << e.what());
+    NLSR_LOG_ERROR("Could not deserialize from content: " << e.what());
     return false;
   }
   return true;
@@ -304,7 +304,7 @@
 void
 AdjLsa::writeLog()
 {
-  _LOG_DEBUG(*this);
+  NLSR_LOG_DEBUG(*this);
 }
 
 std::ostream&
diff --git a/src/lsdb.cpp b/src/lsdb.cpp
index 2d78610..9efc733 100644
--- a/src/lsdb.cpp
+++ b/src/lsdb.cpp
@@ -91,7 +91,7 @@
                       ndn::Name lsaName,
                       uint64_t seqNo)
 {
-  _LOG_DEBUG("Failed to fetch LSA: " << lsaName << ", Error code: " << errorCode
+  NLSR_LOG_DEBUG("Failed to fetch LSA: " << lsaName << ", Error code: " << errorCode
                                                 << ", Message: " << msg);
 
   if (ndn::time::steady_clock::now() < deadline) {
@@ -120,7 +120,7 @@
   std::shared_ptr<ndn::Data> data = std::make_shared<ndn::Data>(ndn::Name(interestName));
   data->setContent(bufferPtr);
 
-  _LOG_DEBUG("Received data for LSA(name): " << data->getName());
+  NLSR_LOG_DEBUG("Received data for LSA(name): " << data->getName());
 
   ndn::Name lsaName = interestName.getSubName(0, interestName.size()-1);
   uint64_t seqNo = interestName[-1].toNumber();
@@ -130,7 +130,7 @@
   }
   else if (seqNo > m_highestSeqNo[lsaName]) {
     m_highestSeqNo[lsaName] = seqNo;
-    _LOG_TRACE("SeqNo for LSA(name): " << data->getName() << "  updated");
+    NLSR_LOG_TRACE("SeqNo for LSA(name): " << data->getName() << "  updated");
   }
   else if (seqNo < m_highestSeqNo[lsaName]) {
     return;
@@ -216,8 +216,8 @@
   // Determines if the name LSA is new or not.
   if (chkNameLsa == 0) {
     addNameLsa(nlsa);
-    _LOG_DEBUG("New Name LSA");
-    _LOG_DEBUG("Adding Name Lsa");
+    NLSR_LOG_DEBUG("New Name LSA");
+    NLSR_LOG_DEBUG("Adding Name Lsa");
     nlsa.writeLog();
 
     if (nlsa.getOrigRouter() != m_nlsr.getConfParameter().getRouterPrefix()) {
@@ -245,8 +245,8 @@
   // Else this is a known name LSA, so we are updating it.
   else {
     if (chkNameLsa->getLsSeqNo() < nlsa.getLsSeqNo()) {
-      _LOG_DEBUG("Updated Name LSA. Updating LSDB");
-      _LOG_DEBUG("Deleting Name Lsa");
+      NLSR_LOG_DEBUG("Updated Name LSA. Updating LSDB");
+      NLSR_LOG_DEBUG("Deleting Name Lsa");
       chkNameLsa->writeLog();
       chkNameLsa->setLsSeqNo(nlsa.getLsSeqNo());
       chkNameLsa->setExpirationTimePoint(nlsa.getExpirationTimePoint());
@@ -277,7 +277,7 @@
                           std::inserter(namesToRemove, namesToRemove.begin()));
       for (std::list<ndn::Name>::iterator it = namesToRemove.begin();
            it != namesToRemove.end(); ++it) {
-        _LOG_DEBUG("Removing name LSA no longer advertised: " << (*it).toUri());
+        NLSR_LOG_DEBUG("Removing name LSA no longer advertised: " << (*it).toUri());
         chkNameLsa->removeName((*it));
         if (nlsa.getOrigRouter() != m_nlsr.getConfParameter().getRouterPrefix()) {
           if ((*it) != m_nlsr.getConfParameter().getRouterPrefix()) {
@@ -295,7 +295,7 @@
       chkNameLsa->setExpiringEventId(scheduleNameLsaExpiration(nlsa.getKey(),
                                                                nlsa.getLsSeqNo(),
                                                                timeToExpire));
-      _LOG_DEBUG("Adding Name Lsa");
+      NLSR_LOG_DEBUG("Adding Name Lsa");
       chkNameLsa->writeLog();
     }
   }
@@ -323,7 +323,7 @@
                                                  m_nameLsdb.end(),
                                                  std::bind(nameLsaCompareByKey, _1, key));
   if (it != m_nameLsdb.end()) {
-    _LOG_DEBUG("Deleting Name Lsa");
+    NLSR_LOG_DEBUG("Deleting Name Lsa");
     (*it).writeLog();
     // If the requested name LSA is not ours, we also need to remove
     // its entries from the NPT.
@@ -358,7 +358,7 @@
 void
 Lsdb::writeNameLsdbLog()
 {
-  _LOG_DEBUG("---------------Name LSDB-------------------");
+  NLSR_LOG_DEBUG("---------------Name LSDB-------------------");
   for (std::list<NameLsa>::iterator it = m_nameLsdb.begin();
        it != m_nameLsdb.end() ; it++) {
     (*it).writeLog();
@@ -453,8 +453,8 @@
   CoordinateLsa* chkCorLsa = findCoordinateLsa(clsa.getKey());
   // Checking whether the LSA is new or not.
   if (chkCorLsa == 0) {
-    _LOG_DEBUG("New Coordinate LSA. Adding to LSDB");
-    _LOG_DEBUG("Adding Coordinate Lsa");
+    NLSR_LOG_DEBUG("New Coordinate LSA. Adding to LSDB");
+    NLSR_LOG_DEBUG("Adding Coordinate Lsa");
     clsa.writeLog();
     addCoordinateLsa(clsa);
 
@@ -478,8 +478,8 @@
   // We are just updating this LSA.
   else {
     if (chkCorLsa->getLsSeqNo() < clsa.getLsSeqNo()) {
-      _LOG_DEBUG("Updated Coordinate LSA. Updating LSDB");
-      _LOG_DEBUG("Deleting Coordinate Lsa");
+      NLSR_LOG_DEBUG("Updated Coordinate LSA. Updating LSDB");
+      NLSR_LOG_DEBUG("Deleting Coordinate Lsa");
       chkCorLsa->writeLog();
       chkCorLsa->setLsSeqNo(clsa.getLsSeqNo());
       chkCorLsa->setExpirationTimePoint(clsa.getExpirationTimePoint());
@@ -501,7 +501,7 @@
       chkCorLsa->setExpiringEventId(scheduleCoordinateLsaExpiration(clsa.getKey(),
                                                                     clsa.getLsSeqNo(),
                                                                     timeToExpire));
-      _LOG_DEBUG("Adding Coordinate Lsa");
+      NLSR_LOG_DEBUG("Adding Coordinate Lsa");
       chkCorLsa->writeLog();
     }
   }
@@ -530,7 +530,7 @@
                                                        std::bind(corLsaCompareByKey,
                                                                  _1, key));
   if (it != m_corLsdb.end()) {
-    _LOG_DEBUG("Deleting Coordinate Lsa");
+    NLSR_LOG_DEBUG("Deleting Coordinate Lsa");
     it->writeLog();
 
     if (it->getOrigRouter() != m_nlsr.getConfParameter().getRouterPrefix()) {
@@ -559,7 +559,7 @@
 void
 Lsdb::writeCorLsdbLog()
 {
-  _LOG_DEBUG("---------------Cor LSDB-------------------");
+  NLSR_LOG_DEBUG("---------------Cor LSDB-------------------");
   for (std::list<CoordinateLsa>::iterator it = m_corLsdb.begin();
        it != m_corLsdb.end() ; it++) {
     (*it).writeLog();
@@ -591,12 +591,12 @@
 
   if (m_nlsr.getConfParameter().getHyperbolicState() == HYPERBOLIC_STATE_ON) {
     // Don't build adjacency LSAs in hyperbolic routing
-    _LOG_DEBUG("Adjacency LSA not built. Currently in hyperbolic routing state.");
+    NLSR_LOG_DEBUG("Adjacency LSA not built. Currently in hyperbolic routing state.");
     return;
   }
 
   if (m_nlsr.getIsBuildAdjLsaSheduled() == false) {
-    _LOG_DEBUG("Scheduling Adjacency LSA build in " << m_adjLsaBuildInterval);
+    NLSR_LOG_DEBUG("Scheduling Adjacency LSA build in " << m_adjLsaBuildInterval);
 
     m_scheduler.scheduleEvent(m_adjLsaBuildInterval, std::bind(&Lsdb::buildAdjLsa, this));
     m_nlsr.setIsBuildAdjLsaSheduled(true);
@@ -606,7 +606,7 @@
 void
 Lsdb::buildAdjLsa()
 {
-  _LOG_TRACE("Lsdb::buildAdjLsa called");
+  NLSR_LOG_TRACE("Lsdb::buildAdjLsa called");
 
   m_nlsr.setIsBuildAdjLsaSheduled(false);
 
@@ -617,7 +617,7 @@
     if (adjBuildCount > 0) {
       // It only makes sense to do the adjLsa build if we have neighbors
       if (m_nlsr.getAdjacencyList().getNumOfActiveNeighbor() > 0) {
-        _LOG_DEBUG("Building and installing own Adj LSA");
+        NLSR_LOG_DEBUG("Building and installing own Adj LSA");
         buildAndInstallOwnAdjLsa();
       }
       // We have no active neighbors, meaning no one can route through
@@ -625,7 +625,7 @@
       // router from refreshing the LSA, eventually causing other
       // routers to delete it, too.
       else {
-        _LOG_DEBUG("Removing own Adj LSA; no ACTIVE neighbors");
+        NLSR_LOG_DEBUG("Removing own Adj LSA; no ACTIVE neighbors");
         // Get this router's key
         ndn::Name key = m_nlsr.getConfParameter().getRouterPrefix();
         key.append(std::to_string(Lsa::Type::ADJACENCY));
@@ -710,8 +710,8 @@
   AdjLsa* chkAdjLsa = findAdjLsa(alsa.getKey());
   // If this adj. LSA is not in the LSDB already
   if (chkAdjLsa == 0) {
-    _LOG_DEBUG("New Adj LSA. Adding to LSDB");
-    _LOG_DEBUG("Adding Adj Lsa");
+    NLSR_LOG_DEBUG("New Adj LSA. Adding to LSDB");
+    NLSR_LOG_DEBUG("Adding Adj Lsa");
     alsa.writeLog();
     addAdjLsa(alsa);
     // Add any new name prefixes to the NPT
@@ -727,8 +727,8 @@
   }
   else {
     if (chkAdjLsa->getLsSeqNo() < alsa.getLsSeqNo()) {
-      _LOG_DEBUG("Updated Adj LSA. Updating LSDB");
-      _LOG_DEBUG("Deleting Adj Lsa");
+      NLSR_LOG_DEBUG("Updated Adj LSA. Updating LSDB");
+      NLSR_LOG_DEBUG("Deleting Adj Lsa");
       chkAdjLsa->writeLog();
       chkAdjLsa->setLsSeqNo(alsa.getLsSeqNo());
       chkAdjLsa->setExpirationTimePoint(alsa.getExpirationTimePoint());
@@ -750,7 +750,7 @@
       chkAdjLsa->setExpiringEventId(scheduleAdjLsaExpiration(alsa.getKey(),
                                                              alsa.getLsSeqNo(),
                                                              timeToExpire));
-      _LOG_DEBUG("Adding Adj Lsa");
+      NLSR_LOG_DEBUG("Adding Adj Lsa");
       chkAdjLsa->writeLog();
     }
   }
@@ -783,7 +783,7 @@
                                                 m_adjLsdb.end(),
                                                 std::bind(adjLsaCompareByKey, _1, key));
   if (it != m_adjLsdb.end()) {
-    _LOG_DEBUG("Deleting Adj Lsa");
+    NLSR_LOG_DEBUG("Deleting Adj Lsa");
     (*it).writeLog();
     (*it).removeNptEntries(m_nlsr);
     m_adjLsdb.erase(it);
@@ -832,22 +832,22 @@
 void
 Lsdb::expireOrRefreshNameLsa(const ndn::Name& lsaKey, uint64_t seqNo)
 {
-  _LOG_DEBUG("Lsdb::expireOrRefreshNameLsa Called");
-  _LOG_DEBUG("LSA Key : " << lsaKey << " Seq No: " << seqNo);
+  NLSR_LOG_DEBUG("Lsdb::expireOrRefreshNameLsa Called");
+  NLSR_LOG_DEBUG("LSA Key : " << lsaKey << " Seq No: " << seqNo);
   NameLsa* chkNameLsa = findNameLsa(lsaKey);
   // If this name LSA exists in the LSDB
   if (chkNameLsa != 0) {
-    _LOG_DEBUG("LSA Exists with seq no: " << chkNameLsa->getLsSeqNo());
+    NLSR_LOG_DEBUG("LSA Exists with seq no: " << chkNameLsa->getLsSeqNo());
     // If its seq no is the one we are expecting.
     if (chkNameLsa->getLsSeqNo() == seqNo) {
       if (chkNameLsa->getOrigRouter() == m_thisRouterPrefix) {
-        _LOG_DEBUG("Own Name LSA, so refreshing it");
-        _LOG_DEBUG("Deleting Name Lsa");
+        NLSR_LOG_DEBUG("Own Name LSA, so refreshing it");
+        NLSR_LOG_DEBUG("Deleting Name Lsa");
         chkNameLsa->writeLog();
         chkNameLsa->setLsSeqNo(chkNameLsa->getLsSeqNo() + 1);
         m_sequencingManager.setNameLsaSeq(chkNameLsa->getLsSeqNo());
         chkNameLsa->setExpirationTimePoint(getLsaExpirationTimePoint());
-        _LOG_DEBUG("Adding Name Lsa");
+        NLSR_LOG_DEBUG("Adding Name Lsa");
         chkNameLsa->writeLog();
         // schedule refreshing event again
         chkNameLsa->setExpiringEventId(scheduleNameLsaExpiration(chkNameLsa->getKey(),
@@ -858,7 +858,7 @@
       }
       // Since we cannot refresh other router's LSAs, our only choice is to expire.
       else {
-        _LOG_DEBUG("Other's Name LSA, so removing from LSDB");
+        NLSR_LOG_DEBUG("Other's Name LSA, so removing from LSDB");
         removeNameLsa(lsaKey);
       }
     }
@@ -875,23 +875,23 @@
 void
 Lsdb::expireOrRefreshAdjLsa(const ndn::Name& lsaKey, uint64_t seqNo)
 {
-  _LOG_DEBUG("Lsdb::expireOrRefreshAdjLsa Called");
-  _LOG_DEBUG("LSA Key: " << lsaKey << " Seq No: " << seqNo);
+  NLSR_LOG_DEBUG("Lsdb::expireOrRefreshAdjLsa Called");
+  NLSR_LOG_DEBUG("LSA Key: " << lsaKey << " Seq No: " << seqNo);
   AdjLsa* chkAdjLsa = findAdjLsa(lsaKey);
   // If this is a valid LSA
   if (chkAdjLsa != 0) {
-    _LOG_DEBUG("LSA Exists with seq no: " << chkAdjLsa->getLsSeqNo());
+    NLSR_LOG_DEBUG("LSA Exists with seq no: " << chkAdjLsa->getLsSeqNo());
     // And if it hasn't been updated for some other reason
     if (chkAdjLsa->getLsSeqNo() == seqNo) {
       // If it is our own LSA
       if (chkAdjLsa->getOrigRouter() == m_thisRouterPrefix) {
-        _LOG_DEBUG("Own Adj LSA, so refreshing it");
-        _LOG_DEBUG("Deleting Adj Lsa");
+        NLSR_LOG_DEBUG("Own Adj LSA, so refreshing it");
+        NLSR_LOG_DEBUG("Deleting Adj Lsa");
         chkAdjLsa->writeLog();
         chkAdjLsa->setLsSeqNo(chkAdjLsa->getLsSeqNo() + 1);
         m_sequencingManager.setAdjLsaSeq(chkAdjLsa->getLsSeqNo());
         chkAdjLsa->setExpirationTimePoint(getLsaExpirationTimePoint());
-        _LOG_DEBUG("Adding Adj Lsa");
+        NLSR_LOG_DEBUG("Adding Adj Lsa");
         chkAdjLsa->writeLog();
         // schedule refreshing event again
         chkAdjLsa->setExpiringEventId(scheduleAdjLsaExpiration(chkAdjLsa->getKey(),
@@ -902,7 +902,7 @@
       }
       // An LSA from another router is expiring
       else {
-        _LOG_DEBUG("Other's Adj LSA, so removing from LSDB");
+        NLSR_LOG_DEBUG("Other's Adj LSA, so removing from LSDB");
         removeAdjLsa(lsaKey);
       }
       // We have changed the contents of the LSDB, so we have to
@@ -923,17 +923,17 @@
 Lsdb::expireOrRefreshCoordinateLsa(const ndn::Name& lsaKey,
                                     uint64_t seqNo)
 {
-  _LOG_DEBUG("Lsdb::expireOrRefreshCorLsa Called ");
-  _LOG_DEBUG("LSA Key : " << lsaKey << " Seq No: " << seqNo);
+  NLSR_LOG_DEBUG("Lsdb::expireOrRefreshCorLsa Called ");
+  NLSR_LOG_DEBUG("LSA Key : " << lsaKey << " Seq No: " << seqNo);
   CoordinateLsa* chkCorLsa = findCoordinateLsa(lsaKey);
   // Whether the LSA is in the LSDB or not.
   if (chkCorLsa != 0) {
-    _LOG_DEBUG("LSA Exists with seq no: " << chkCorLsa->getLsSeqNo());
+    NLSR_LOG_DEBUG("LSA Exists with seq no: " << chkCorLsa->getLsSeqNo());
     // Whether the LSA has been updated without our knowledge.
     if (chkCorLsa->getLsSeqNo() == seqNo) {
       if (chkCorLsa->getOrigRouter() == m_thisRouterPrefix) {
-        _LOG_DEBUG("Own Cor LSA, so refreshing it");
-        _LOG_DEBUG("Deleting Coordinate Lsa");
+        NLSR_LOG_DEBUG("Own Cor LSA, so refreshing it");
+        NLSR_LOG_DEBUG("Deleting Coordinate Lsa");
         chkCorLsa->writeLog();
         chkCorLsa->setLsSeqNo(chkCorLsa->getLsSeqNo() + 1);
         if (m_nlsr.getConfParameter().getHyperbolicState() != HYPERBOLIC_STATE_OFF) {
@@ -941,7 +941,7 @@
         }
 
         chkCorLsa->setExpirationTimePoint(getLsaExpirationTimePoint());
-        _LOG_DEBUG("Adding Coordinate Lsa");
+        NLSR_LOG_DEBUG("Adding Coordinate Lsa");
         chkCorLsa->writeLog();
         // schedule refreshing event again
         chkCorLsa->setExpiringEventId(scheduleCoordinateLsaExpiration(
@@ -956,7 +956,7 @@
       }
       // We can't refresh other router's LSAs, so we remove it.
       else {
-        _LOG_DEBUG("Other's Cor LSA, so removing from LSDB");
+        NLSR_LOG_DEBUG("Other's Cor LSA, so removing from LSDB");
         removeCoordinateLsa(lsaKey);
       }
       if (m_nlsr.getConfParameter().getHyperbolicState() == HYPERBOLIC_STATE_ON) {
@@ -997,7 +997,7 @@
   ndn::Interest interest(interestName);
   interest.setInterestLifetime(m_nlsr.getConfParameter().getLsaInterestLifetime());
 
-  _LOG_DEBUG("Fetching Data for LSA: " << interestName << " Seq number: " << seqNo);
+  NLSR_LOG_DEBUG("Fetching Data for LSA: " << interestName << " Seq number: " << seqNo);
   ndn::util::SegmentFetcher::fetch(m_nlsr.getNlsrFace(), interest,
                                    m_nlsr.getValidator(),
                                    std::bind(&Lsdb::afterFetchLsa, this, _1, interestName),
@@ -1017,7 +1017,7 @@
     lsaIncrementSignal(Statistics::PacketType::SENT_NAME_LSA_INTEREST);
     break;
   default:
-    _LOG_ERROR("lsaType " << lsaType << " not recognized; failed Statistics::PacketType conversion");
+    NLSR_LOG_ERROR("lsaType " << lsaType << " not recognized; failed Statistics::PacketType conversion");
   }
 }
 
@@ -1028,7 +1028,7 @@
   lsaIncrementSignal(Statistics::PacketType::RCV_LSA_INTEREST);
 
   const ndn::Name& interestName(interest.getName());
-  _LOG_DEBUG("Interest received for LSA: " << interestName);
+  NLSR_LOG_DEBUG("Interest received for LSA: " << interestName);
 
   std::string chkString("LSA");
   int32_t lsaPosition = util::getNameComponentPosition(interest.getName(), chkString);
@@ -1041,7 +1041,7 @@
                                                 interest.getName().size() - lsaPosition - 3));
 
     uint64_t seqNo = interestName[-1].toNumber();
-    _LOG_DEBUG("LSA sequence number from interest: " << seqNo);
+    NLSR_LOG_DEBUG("LSA sequence number from interest: " << seqNo);
 
     Lsa::Type interestedLsType;
     std::istringstream(interestName[-2].toUri()) >> interestedLsType;
@@ -1059,7 +1059,7 @@
                                       seqNo);
     }
     else {
-      _LOG_WARN("Received unrecognized LSA type: " << interestedLsType);
+      NLSR_LOG_WARN("Received unrecognized LSA type: " << interestedLsType);
     }
     lsaIncrementSignal(Statistics::PacketType::SENT_LSA_DATA);
   }
@@ -1075,7 +1075,7 @@
                                 m_nlsr.getKeyChain(),
                                 m_lsaRefreshTime,
                                 content);
-  _LOG_DEBUG("Sending requested data ( " << content << ")  for interest (" << interest
+  NLSR_LOG_DEBUG("Sending requested data ( " << content << ")  for interest (" << interest
              << ") to be published and added to face.");
   publisher.publish(interest.getName(),
                     ndn::security::signingByCertificate(m_nlsr.getDefaultCertName()));
@@ -1093,7 +1093,7 @@
 {
   // increment RCV_NAME_LSA_INTEREST
   lsaIncrementSignal(Statistics::PacketType::RCV_NAME_LSA_INTEREST);
-  _LOG_DEBUG("nameLsa interest " << interest << " received");
+  NLSR_LOG_DEBUG("nameLsa interest " << interest << " received");
   NameLsa*  nameLsa = m_nlsr.getLsdb().findNameLsa(lsaKey);
   if (nameLsa != 0) {
     if (nameLsa->getLsSeqNo() == seqNo) {
@@ -1103,11 +1103,11 @@
       lsaIncrementSignal(Statistics::PacketType::SENT_NAME_LSA_DATA);
     }
     else {
-      _LOG_TRACE("SeqNo for nameLsa does not match");
+      NLSR_LOG_TRACE("SeqNo for nameLsa does not match");
     }
   }
   else {
-    _LOG_TRACE(interest << "  was not found in this lsdb");
+    NLSR_LOG_TRACE(interest << "  was not found in this lsdb");
   }
 }
 
@@ -1122,12 +1122,12 @@
                                      uint64_t seqNo)
 {
   if (m_nlsr.getConfParameter().getHyperbolicState() == HYPERBOLIC_STATE_ON) {
-    _LOG_ERROR("Received interest for an adjacency LSA when hyperbolic routing is enabled");
+    NLSR_LOG_ERROR("Received interest for an adjacency LSA when hyperbolic routing is enabled");
   }
 
   // increment RCV_ADJ_LSA_INTEREST
   lsaIncrementSignal(Statistics::PacketType::RCV_ADJ_LSA_INTEREST);
-  _LOG_DEBUG("AdjLsa interest " << interest << " received");
+  NLSR_LOG_DEBUG("AdjLsa interest " << interest << " received");
   AdjLsa* adjLsa = m_nlsr.getLsdb().findAdjLsa(lsaKey);
   if (adjLsa != 0) {
     if (adjLsa->getLsSeqNo() == seqNo) {
@@ -1137,11 +1137,11 @@
       lsaIncrementSignal(Statistics::PacketType::SENT_ADJ_LSA_DATA);
     }
     else {
-      _LOG_TRACE("SeqNo for AdjLsa does not match");
+      NLSR_LOG_TRACE("SeqNo for AdjLsa does not match");
     }
   }
   else {
-    _LOG_TRACE(interest << "  was not found in this lsdb");
+    NLSR_LOG_TRACE(interest << "  was not found in this lsdb");
   }
 }
 
@@ -1156,12 +1156,12 @@
                                       uint64_t seqNo)
 {
   if (m_nlsr.getConfParameter().getHyperbolicState() == HYPERBOLIC_STATE_OFF) {
-    _LOG_ERROR("Received Interest for a coordinate LSA when link-state routing is enabled");
+    NLSR_LOG_ERROR("Received Interest for a coordinate LSA when link-state routing is enabled");
   }
 
   // increment RCV_COORD_LSA_INTEREST
   lsaIncrementSignal(Statistics::PacketType::RCV_COORD_LSA_INTEREST);
-  _LOG_DEBUG("CoordinateLsa interest " << interest << " received");
+  NLSR_LOG_DEBUG("CoordinateLsa interest " << interest << " received");
   CoordinateLsa* corLsa = m_nlsr.getLsdb().findCoordinateLsa(lsaKey);
   if (corLsa != 0) {
     if (corLsa->getLsSeqNo() == seqNo) {
@@ -1171,11 +1171,11 @@
       lsaIncrementSignal(Statistics::PacketType::SENT_COORD_LSA_DATA);
     }
     else {
-      _LOG_TRACE("SeqNo for CoordinateLsa does not match");
+      NLSR_LOG_TRACE("SeqNo for CoordinateLsa does not match");
     }
   }
   else {
-    _LOG_TRACE(interest << "  was not found in this lsdb");
+    NLSR_LOG_TRACE(interest << "  was not found in this lsdb");
   }
 }
 
@@ -1183,7 +1183,7 @@
 Lsdb::onContentValidated(const std::shared_ptr<const ndn::Data>& data)
 {
   const ndn::Name& dataName = data->getName();
-  _LOG_DEBUG("Data validation successful for LSA: " << dataName);
+  NLSR_LOG_DEBUG("Data validation successful for LSA: " << dataName);
 
   std::string chkString("LSA");
   int32_t lsaPosition = util::getNameComponentPosition(dataName, chkString);
@@ -1214,7 +1214,7 @@
                                   dataContent);
     }
     else {
-      _LOG_WARN("Received unrecognized LSA Type: " << interestedLsType);
+      NLSR_LOG_WARN("Received unrecognized LSA Type: " << interestedLsType);
     }
 
     // increment RCV_LSA_DATA
@@ -1234,7 +1234,7 @@
       installNameLsa(nameLsa);
     }
     else {
-      _LOG_DEBUG("LSA data decoding error :(");
+      NLSR_LOG_DEBUG("LSA data decoding error :(");
     }
   }
 }
@@ -1251,7 +1251,7 @@
       installAdjLsa(adjLsa);
     }
     else {
-      _LOG_DEBUG("LSA data decoding error :(");
+      NLSR_LOG_DEBUG("LSA data decoding error :(");
     }
   }
 }
@@ -1268,7 +1268,7 @@
       installCoordinateLsa(corLsa);
     }
     else {
-      _LOG_DEBUG("LSA data decoding error :(");
+      NLSR_LOG_DEBUG("LSA data decoding error :(");
     }
   }
 }
@@ -1285,7 +1285,7 @@
 void
 Lsdb::writeAdjLsdbLog()
 {
-  _LOG_DEBUG("---------------Adj LSDB-------------------");
+  NLSR_LOG_DEBUG("---------------Adj LSDB-------------------");
   for (std::list<AdjLsa>::iterator it = m_adjLsdb.begin();
        it != m_adjLsdb.end() ; it++) {
     (*it).writeLog();
diff --git a/src/nlsr-runner.cpp b/src/nlsr-runner.cpp
index 84ec812..652139f 100644
--- a/src/nlsr-runner.cpp
+++ b/src/nlsr-runner.cpp
@@ -74,7 +74,7 @@
     m_nlsr.startEventLoop();
   }
   catch (const std::exception& e) {
-    _LOG_FATAL("ERROR: " << e.what());
+    NLSR_LOG_FATAL("ERROR: " << e.what());
     std::cerr << "ERROR: " << e.what() << std::endl;
 
     m_nlsr.getFib().clean();
diff --git a/src/nlsr.cpp b/src/nlsr.cpp
index a54f737..da9de61 100644
--- a/src/nlsr.cpp
+++ b/src/nlsr.cpp
@@ -89,14 +89,14 @@
 void
 Nlsr::registrationFailed(const ndn::Name& name)
 {
-  _LOG_ERROR("ERROR: Failed to register prefix in local hub's daemon");
+  NLSR_LOG_ERROR("ERROR: Failed to register prefix in local hub's daemon");
   BOOST_THROW_EXCEPTION(Error("Error: Prefix registration failed"));
 }
 
 void
 Nlsr::onRegistrationSuccess(const ndn::Name& name)
 {
-  _LOG_DEBUG("Successfully registered prefix: " << name);
+  NLSR_LOG_DEBUG("Successfully registered prefix: " << name);
 
   if (name.equals(m_confParam.getRouterPrefix())) {
     // the top-level prefixes are added.
@@ -104,7 +104,7 @@
       m_routerNameDispatcher.addTopPrefix(m_confParam.getRouterPrefix(), false, m_signingInfo);
     }
     catch (const std::exception& e) {
-      _LOG_ERROR("Error setting top-level prefix in dispatcher: " << e.what() << "\n");
+      NLSR_LOG_ERROR("Error setting top-level prefix in dispatcher: " << e.what() << "\n");
     }
   }
 }
@@ -118,7 +118,7 @@
     m_localhostDispatcher.addTopPrefix(LOCALHOST_PREFIX, false, m_signingInfo);
   }
   catch (const std::exception& e) {
-    _LOG_ERROR("Error setting top-level prefix in dispatcher: " << e.what() << "\n");
+    NLSR_LOG_ERROR("Error setting top-level prefix in dispatcher: " << e.what() << "\n");
   }
 }
 
@@ -126,7 +126,7 @@
 Nlsr::setInfoInterestFilter()
 {
   ndn::Name name(m_confParam.getRouterPrefix());
-  _LOG_DEBUG("Setting interest filter for name: " << name);
+  NLSR_LOG_DEBUG("Setting interest filter for name: " << name);
   getNlsrFace().setInterestFilter(name,
                                   std::bind(&HelloProtocol::processInterest,
                                             &m_helloProtocol, _1, _2),
@@ -142,7 +142,7 @@
   ndn::Name name = m_confParam.getLsaPrefix();
   name.append(m_confParam.getSiteName());
   name.append(m_confParam.getRouterName());
-  _LOG_DEBUG("Setting interest filter for LsaPrefix: " << name);
+  NLSR_LOG_DEBUG("Setting interest filter for LsaPrefix: " << name);
   getNlsrFace().setInterestFilter(name,
                                   std::bind(&Lsdb::processInterest,
                                             &m_nlsrLsdb, _1, _2),
@@ -176,7 +176,7 @@
     BOOST_THROW_EXCEPTION(Error("Error: Daemonization process- fork failed!"));
   }
   if (process_id > 0) {
-    _LOG_DEBUG("Process daemonized. Process id: " << process_id);
+    NLSR_LOG_DEBUG("Process daemonized. Process id: " << process_id);
     exit(0);
   }
 
@@ -209,13 +209,13 @@
   if (currentNeighbor != m_adjacencyList.getAdjList().end()) {
     ndn::util::FaceUri uri(currentNeighbor->getFaceUri());
     uri.canonize([this, then, currentNeighbor] (ndn::util::FaceUri canonicalUri) {
-        _LOG_DEBUG("Canonized URI: " << currentNeighbor->getFaceUri()
+        NLSR_LOG_DEBUG("Canonized URI: " << currentNeighbor->getFaceUri()
                    << " to: " << canonicalUri);
         currentNeighbor->setFaceUri(canonicalUri);
         then(std::next(currentNeighbor));
       },
       [this, then, currentNeighbor] (const std::string& reason) {
-        _LOG_ERROR("Could not canonize URI: " << currentNeighbor->getFaceUri()
+        NLSR_LOG_ERROR("Could not canonize URI: " << currentNeighbor->getFaceUri()
                    << " because: " << reason);
         then(std::next(currentNeighbor));
       },
@@ -231,7 +231,7 @@
 void
 Nlsr::initialize()
 {
-  _LOG_DEBUG("Initializing Nlsr");
+  NLSR_LOG_DEBUG("Initializing Nlsr");
   m_confParam.buildRouterPrefix();
   m_lsdbDatasetHandler.setRouterNameCommandPrefix(m_confParam.getRouterPrefix());
   m_nlsrLsdb.setLsaRefreshTime(ndn::time::seconds(m_confParam.getLsaRefreshTime()));
@@ -246,11 +246,11 @@
   // Logging start
   m_confParam.writeLog();
   m_adjacencyList.writeLog();
-  _LOG_DEBUG(m_namePrefixList);
+  NLSR_LOG_DEBUG(m_namePrefixList);
   // Logging end
   initializeKey();
   setStrategies();
-  _LOG_DEBUG("Default NLSR identity: " << m_signingInfo.getSignerName());
+  NLSR_LOG_DEBUG("Default NLSR identity: " << m_signingInfo.getSignerName());
   setInfoInterestFilter();
   setLsaInterestFilter();
 
@@ -355,7 +355,7 @@
     }
   else if (certName[-1].toUri() != "ID-CERT")
     {
-      _LOG_DEBUG("certName for interest " << interest << " is malformed,"
+      NLSR_LOG_DEBUG("certName for interest " << interest << " is malformed,"
                  << " contains incorrect namespace syntax");
       return;
     }
@@ -364,7 +364,7 @@
 
   if (!static_cast<bool>(cert))
     {
-      _LOG_DEBUG("cert is not found for " << interest);
+      NLSR_LOG_DEBUG("cert is not found for " << interest);
       return; // cert is not found
     }
 
@@ -384,7 +384,7 @@
 void
 Nlsr::onFaceEventNotification(const ndn::nfd::FaceEventNotification& faceEventNotification)
 {
-  _LOG_TRACE("Nlsr::onFaceEventNotification called");
+  NLSR_LOG_TRACE("Nlsr::onFaceEventNotification called");
 
   switch (faceEventNotification.getKind()) {
     case ndn::nfd::FACE_EVENT_DESTROYED: {
@@ -393,7 +393,7 @@
       auto adjacent = m_adjacencyList.findAdjacent(faceId);
 
       if (adjacent != m_adjacencyList.end()) {
-        _LOG_DEBUG("Face to " << adjacent->getName() << " with face id: " << faceId << " destroyed");
+        NLSR_LOG_DEBUG("Face to " << adjacent->getName() << " with face id: " << faceId << " destroyed");
 
         adjacent->setFaceId(0);
 
@@ -436,7 +436,7 @@
       // If we have a neighbor by that FaceUri and it has no FaceId, we
       // have a match.
       if (adjacent != m_adjacencyList.end()) {
-        _LOG_DEBUG("Face creation event matches neighbor: " << adjacent->getName()
+        NLSR_LOG_DEBUG("Face creation event matches neighbor: " << adjacent->getName()
                    << ". New Face ID: " << faceEventNotification.getFaceId()
                    << ". Registering prefixes.");
         adjacent->setFaceId(faceEventNotification.getFaceId());
@@ -461,7 +461,7 @@
 Nlsr::initializeFaces(const FetchDatasetCallback& onFetchSuccess,
                       const FetchDatasetTimeoutCallback& onFetchFailure)
 {
-  _LOG_TRACE("Initializing Faces...");
+  NLSR_LOG_TRACE("Initializing Faces...");
 
   m_faceDatasetController.fetch<ndn::nfd::FaceDataset>(onFetchSuccess, onFetchFailure);
 
@@ -470,7 +470,7 @@
 void
 Nlsr::processFaceDataset(const std::vector<ndn::nfd::FaceStatus>& faces)
 {
-  _LOG_DEBUG("Processing face dataset");
+  NLSR_LOG_DEBUG("Processing face dataset");
 
   // Iterate over each neighbor listed in nlsr.conf
   for (auto& adjacent : m_adjacencyList.getAdjList()) {
@@ -481,7 +481,7 @@
       // Set the adjacency FaceID if we find a URI match and it was
       // previously unset. Change the boolean to true.
       if (adjacent.getFaceId() == 0 && faceUriString == faceStatus.getRemoteUri()) {
-        _LOG_DEBUG("FaceUri: " << faceStatus.getRemoteUri() <<
+        NLSR_LOG_DEBUG("FaceUri: " << faceStatus.getRemoteUri() <<
                    " FaceId: "<< faceStatus.getFaceId());
         adjacent.setFaceId(faceStatus.getFaceId());
         // Register the prefixes for each neighbor
@@ -493,7 +493,7 @@
     // Face wasn't ready yet, or 2. NFD is configured
     // incorrectly and this Face isn't available.
     if (adjacent.getFaceId() == 0) {
-      _LOG_WARN("The adjacency " << adjacent.getName() <<
+      NLSR_LOG_WARN("The adjacency " << adjacent.getName() <<
                 " has no Face information in this dataset.");
     }
   }
@@ -531,17 +531,17 @@
                                 const std::string& msg,
                                 uint32_t nRetriesSoFar)
 {
-  _LOG_DEBUG("onFaceDatasetFetchTimeout");
+  NLSR_LOG_DEBUG("onFaceDatasetFetchTimeout");
   // If we have exceeded the maximum attempt count, do not try again.
   if (nRetriesSoFar++ < m_confParam.getFaceDatasetFetchTries()) {
-    _LOG_DEBUG("Failed to fetch dataset: " << msg << ". Attempting retry #" << nRetriesSoFar);
+    NLSR_LOG_DEBUG("Failed to fetch dataset: " << msg << ". Attempting retry #" << nRetriesSoFar);
     m_faceDatasetController.fetch<ndn::nfd::FaceDataset>(std::bind(&Nlsr::processFaceDataset,
                                                         this, _1),
                                               std::bind(&Nlsr::onFaceDatasetFetchTimeout,
                                                         this, _1, _2, nRetriesSoFar));
   }
   else {
-    _LOG_ERROR("Failed to fetch dataset: " << msg << ". Exceeded limit of " <<
+    NLSR_LOG_ERROR("Failed to fetch dataset: " << msg << ". Exceeded limit of " <<
                m_confParam.getFaceDatasetFetchTries() << ", so not trying again this time.");
     // If we fail to fetch it, just do nothing until the next
     // interval.  Since this is a backup mechanism, we aren't as
@@ -553,7 +553,7 @@
 void
 Nlsr::scheduleDatasetFetch()
 {
-  _LOG_DEBUG("Scheduling Dataset Fetch in " << m_confParam.getFaceDatasetFetchInterval()
+  NLSR_LOG_DEBUG("Scheduling Dataset Fetch in " << m_confParam.getFaceDatasetFetchInterval()
              << " seconds");
   m_scheduler.scheduleEvent(m_confParam.getFaceDatasetFetchInterval(),
     [this] {
diff --git a/src/publisher/lsdb-dataset-interest-handler.cpp b/src/publisher/lsdb-dataset-interest-handler.cpp
index 7a4ba1c..53cdfbc 100644
--- a/src/publisher/lsdb-dataset-interest-handler.cpp
+++ b/src/publisher/lsdb-dataset-interest-handler.cpp
@@ -54,7 +54,7 @@
   , m_localhostDispatcher(localHostDispatcher)
   , m_routerNameDispatcher(routerNameDispatcher)
 {
-  _LOG_DEBUG("Setting dispatcher for lsdb status dataset:");
+  NLSR_LOG_DEBUG("Setting dispatcher for lsdb status dataset:");
   setDispatcher(m_localhostDispatcher);
   setDispatcher(m_routerNameDispatcher);
 }
@@ -80,7 +80,7 @@
 LsdbDatasetInterestHandler::publishAdjStatus(const ndn::Name& topPrefix, const ndn::Interest& interest,
                                              ndn::mgmt::StatusDatasetContext& context)
 {
-  _LOG_DEBUG("Received interest:  " << interest);
+  NLSR_LOG_DEBUG("Received interest:  " << interest);
 
   auto lsaRange = std::make_pair<std::list<AdjLsa>::const_iterator,
                                  std::list<AdjLsa>::const_iterator>(
@@ -111,7 +111,7 @@
                                  std::list<CoordinateLsa>::const_iterator>(
     m_lsdb.getCoordinateLsdb().cbegin(), m_lsdb.getCoordinateLsdb().cend());
 
-  _LOG_DEBUG("Received interest:  " << interest);
+  NLSR_LOG_DEBUG("Received interest:  " << interest);
   for (auto lsa = lsaRange.first; lsa != lsaRange.second; lsa++) {
     tlv::CoordinateLsa tlvLsa;
     std::shared_ptr<tlv::LsaInfo> tlvLsaInfo = tlv::makeLsaInfo(*lsa);
@@ -132,7 +132,7 @@
 {
   auto lsaRange = std::make_pair<std::list<NameLsa>::const_iterator, std::list<NameLsa>::const_iterator>(
     m_lsdb.getNameLsdb().cbegin(), m_lsdb.getNameLsdb().cend());
-  _LOG_DEBUG("Received interest:  " << interest);
+  NLSR_LOG_DEBUG("Received interest:  " << interest);
   for (auto lsa = lsaRange.first; lsa != lsaRange.second; lsa++) {
     tlv::NameLsa tlvLsa;
 
@@ -153,7 +153,7 @@
 LsdbDatasetInterestHandler::publishAllStatus(const ndn::Name& topPrefix, const ndn::Interest& interest,
                                              ndn::mgmt::StatusDatasetContext& context)
 {
-  _LOG_DEBUG("Received interest:  " << interest);
+  NLSR_LOG_DEBUG("Received interest:  " << interest);
   tlv::LsdbStatus lsdbStatus;
   for (const tlv::AdjacencyLsa& tlvLsa : getTlvLsas<tlv::AdjacencyLsa>(m_lsdb)) {
     lsdbStatus.addAdjacencyLsa(tlvLsa);
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(),
diff --git a/src/sequencing-manager.cpp b/src/sequencing-manager.cpp
index 810be68..cdcbad9 100644
--- a/src/sequencing-manager.cpp
+++ b/src/sequencing-manager.cpp
@@ -50,7 +50,7 @@
 void
 SequencingManager::initiateSeqNoFromFile(int hypState)
 {
-  _LOG_DEBUG("Seq File Name: " << m_seqFileNameWithPath);
+  NLSR_LOG_DEBUG("Seq File Name: " << m_seqFileNameWithPath);
   std::ifstream inputFile(m_seqFileNameWithPath.c_str());
 
   // Good checks that file is not (bad or eof or fail)
@@ -74,7 +74,7 @@
     // lsaOrCombinedSeqNo != CorLsaSeq
     if (m_nameLsaSeq == 0 && m_adjLsaSeq == 0 && m_corLsaSeq == 0 &&
         lsaOrCombinedSeqNo != "CorLsaSeq") {
-      _LOG_DEBUG("Old file had combined sequence number: " << lsaOrCombinedSeqNo);
+      NLSR_LOG_DEBUG("Old file had combined sequence number: " << lsaOrCombinedSeqNo);
       std::istringstream iss(lsaOrCombinedSeqNo);
       iss >> seqNo;
       m_adjLsaSeq = (seqNo & 0xFFFFF);
@@ -89,7 +89,7 @@
     // Increment the adjacency LSA seq. no. if link-state or dry HR is enabled
     if (hypState != HYPERBOLIC_STATE_ON) {
       if (m_corLsaSeq != 0) {
-        _LOG_WARN("This router was previously configured for hyperbolic"
+        NLSR_LOG_WARN("This router was previously configured for hyperbolic"
                    << " routing without clearing the seq. no. file.");
         m_corLsaSeq = 0;
       }
@@ -99,7 +99,7 @@
     // Similarly, increment the coordinate LSA seq. no only if link-state is disabled.
     if (hypState != HYPERBOLIC_STATE_OFF) {
       if (m_adjLsaSeq != 0) {
-        _LOG_WARN("This router was previously configured for link-state"
+        NLSR_LOG_WARN("This router was previously configured for link-state"
                   << " routing without clearing the seq. no. file.");
         m_adjLsaSeq = 0;
       }
@@ -127,10 +127,10 @@
 void
 SequencingManager::writeLog() const
 {
-  _LOG_DEBUG("----SequencingManager----");
-  _LOG_DEBUG("Adj LSA seq no: " << m_adjLsaSeq);
-  _LOG_DEBUG("Cor LSA Seq no: " << m_corLsaSeq);
-  _LOG_DEBUG("Name LSA Seq no: " << m_nameLsaSeq);
+  NLSR_LOG_DEBUG("----SequencingManager----");
+  NLSR_LOG_DEBUG("Adj LSA seq no: " << m_adjLsaSeq);
+  NLSR_LOG_DEBUG("Cor LSA Seq no: " << m_corLsaSeq);
+  NLSR_LOG_DEBUG("Name LSA Seq no: " << m_nameLsaSeq);
 }
 
 } // namespace nlsr
diff --git a/src/update/manager-base.cpp b/src/update/manager-base.cpp
index 47ff076..5a1034c 100644
--- a/src/update/manager-base.cpp
+++ b/src/update/manager-base.cpp
@@ -61,7 +61,7 @@
 
   // Only build a Name LSA if the added name is new
   if (m_namePrefixList.insert(castParams.getName())) {
-    _LOG_INFO("Advertising/Inserting name: " << castParams.getName() << "\n");
+    NLSR_LOG_INFO("Advertising/Inserting name: " << castParams.getName() << "\n");
     m_lsdb.buildAndInstallOwnNameLsa();
     return done(ndn::nfd::ControlResponse(200, "OK").setBody(parameters.wireEncode()));
   }
@@ -80,7 +80,7 @@
 
   // Only build a Name LSA if the added name is new
   if (m_namePrefixList.remove(castParams.getName())) {
-    _LOG_INFO("Withdrawing/Removing name: " << castParams.getName() << "\n");
+    NLSR_LOG_INFO("Withdrawing/Removing name: " << castParams.getName() << "\n");
     m_lsdb.buildAndInstallOwnNameLsa();
     return done(ndn::nfd::ControlResponse(200, "OK").setBody(parameters.wireEncode()));
   }
diff --git a/src/update/prefix-update-processor.cpp b/src/update/prefix-update-processor.cpp
index 6146441..4ad75dd 100644
--- a/src/update/prefix-update-processor.cpp
+++ b/src/update/prefix-update-processor.cpp
@@ -60,7 +60,7 @@
   : CommandManagerBase(dispatcher, namePrefixList, lsdb, "prefix-update")
   , m_validator(face, broadcastPrefix, certificateCache, certStore)
 {
-  _LOG_DEBUG("Setting dispatcher to capture Interests for: "
+  NLSR_LOG_DEBUG("Setting dispatcher to capture Interests for: "
     << ndn::Name(Nlsr::LOCALHOST_PREFIX).append("prefix-update"));
 
   m_dispatcher.addControlCommand<ndn::nfd::ControlParameters>(makeRelPrefix("advertise"),
@@ -88,12 +88,12 @@
 
         auto signer1 = getSignerFromTag(*request);
         std::string signer = signer1.value_or("*");
-        _LOG_DEBUG("accept " << request->getName() << " signer=" << signer);
+        NLSR_LOG_DEBUG("accept " << request->getName() << " signer=" << signer);
         accept(signer);
       },
       [reject] (const std::shared_ptr<const ndn::Interest>& request,
                 const std::string& failureInfo) {
-        _LOG_DEBUG("reject " << request->getName() << " signer=" <<
+        NLSR_LOG_DEBUG("reject " << request->getName() << " signer=" <<
                       getSignerFromTag(*request).value_or("?") << ' ' << failureInfo);
         reject(ndn::mgmt::RejectReply::STATUS403);
       });
