diff --git a/src/adjacency-list.cpp b/src/adjacency-list.cpp
index c028942..a905a7d 100644
--- a/src/adjacency-list.cpp
+++ b/src/adjacency-list.cpp
@@ -243,14 +243,4 @@
   }
 }
 
-// used for debugging purpose
-void
-AdjacencyList::print()
-{
-  for (std::list<Adjacent>::iterator it = m_adjList.begin();
-       it != m_adjList.end(); it++) {
-    cout << (*it) << endl;
-  }
-}
-
 } //namespace nlsr
diff --git a/src/adjacency-list.hpp b/src/adjacency-list.hpp
index d9105b4..85bec25 100644
--- a/src/adjacency-list.hpp
+++ b/src/adjacency-list.hpp
@@ -99,9 +99,6 @@
   }
 
   void
-  print();
-
-  void
   writeLog();
 
 private:
diff --git a/src/adjacent.cpp b/src/adjacent.cpp
index c4f131b..ddee24f 100644
--- a/src/adjacent.cpp
+++ b/src/adjacent.cpp
@@ -90,15 +90,4 @@
   _LOG_DEBUG("Interest Timed out: " << m_interestTimedOutNo);
 }
 
-std::ostream&
-operator<<(std::ostream& os, const Adjacent& adj)
-{
-  os << "Adjacent : " << adj.getName() << endl;
-  os << "Connecting FaceUri: " << adj.getConnectingFaceUri() << endl;
-  os << "Link Cost: " << adj.getLinkCost() << endl;
-  os << "Status: " << adj.getStatus() << endl;
-  os << "Interest Timed out: " << adj.getInterestTimedOutNo() << endl;
-  return os;
-}
-
 } //namespace nlsr
diff --git a/src/adjacent.hpp b/src/adjacent.hpp
index 6d076b5..90a0460 100644
--- a/src/adjacent.hpp
+++ b/src/adjacent.hpp
@@ -125,9 +125,6 @@
   uint32_t m_interestTimedOutNo;
 };
 
-std::ostream&
-operator<<(std::ostream& os, const Adjacent& adj);
-
 } // namespace nlsr
 
 #endif //NLSR_ADJACENT_HPP
diff --git a/src/communication/sync-logic-handler.cpp b/src/communication/sync-logic-handler.cpp
index 65039bf..dea3782 100644
--- a/src/communication/sync-logic-handler.cpp
+++ b/src/communication/sync-logic-handler.cpp
@@ -37,8 +37,6 @@
 SyncLogicHandler::createSyncSocket(Nlsr& pnlsr)
 {
   _LOG_DEBUG("Creating Sync socket. Sync Prefix: " << m_syncPrefix);
-  std::cout << "Creating Sync socket ......" << std::endl;
-  std::cout << "Sync prefix: " << m_syncPrefix << std::endl;
   m_syncSocket = ndn::make_shared<Sync::SyncSocket>(m_syncPrefix, m_validator,
                                                     m_syncFace,
                                                     ndn::bind(&SyncLogicHandler::nsyncUpdateCallBack,
@@ -52,12 +50,9 @@
                                       Sync::SyncSocket* socket, Nlsr& pnlsr)
 {
   _LOG_DEBUG("nsyncUpdateCallBack called ....");
-  std::cout << "nsyncUpdateCallBack called ...." << std::endl;
   int32_t n = v.size();
   for (int32_t i = 0; i < n; i++){
-    _LOG_DEBUG("Data Name: " << v[i].prefix << " Seq: " << v[i].high.getSeq());
-    std::cout << "Data Name: " << v[i].prefix << " Seq: " << v[i].high.getSeq() <<
-              endl;
+    _LOG_DEBUG("Update Name: " << v[i].prefix << " Seq: " << v[i].high.getSeq());
     processUpdateFromSync(v[i].prefix, v[i].high.getSeq(), pnlsr);
   }
 }
@@ -66,7 +61,6 @@
 SyncLogicHandler::nsyncRemoveCallBack(const string& prefix, Nlsr& pnlsr)
 {
   _LOG_DEBUG("nsyncRemoveCallBack called ....");
-  std::cout << "nsyncRemoveCallBack called ...." << std::endl;
 }
 
 void
@@ -94,11 +88,10 @@
   ndn::Name rName = routerName;
   if (routerName != pnlsr.getConfParameter().getRouterPrefix()) {
     SequencingManager sm(seqNo);
-    std::cout << sm;
-    //std::cout << "Router Name: " << routerName << endl;
+    sm.writeLog();
+    _LOG_DEBUG(routerName);
     try {
       if (pnlsr.getLsdb().isNameLsaNew(rName.append("name"), sm.getNameLsaSeq())) {
-        std::cout << "Updated Name LSA. Need to fetch it" << std::endl;
         _LOG_DEBUG("Updated Name LSA. Need to fetch it");
         ndn::Name interestName(pnlsr.getConfParameter().getLsaPrefix());
         interestName.append(routerName);
@@ -108,9 +101,7 @@
                                         pnlsr.getConfParameter().getInterestResendTime(),
                                         0);
       }
-      if (pnlsr.getLsdb().isAdjLsaNew(rName.append("adjacency"),
-                                      sm.getAdjLsaSeq())) {
-        std::cout << "Updated Adj LSA. Need to fetch it" << std::endl;
+      if (pnlsr.getLsdb().isAdjLsaNew(rName.append("adjacency"), sm.getAdjLsaSeq())) {
         _LOG_DEBUG("Updated Adj LSA. Need to fetch it");
         ndn::Name interestName(pnlsr.getConfParameter().getLsaPrefix());
         interestName.append(routerName);
@@ -122,7 +113,6 @@
       }
       if (pnlsr.getLsdb().isCoordinateLsaNew(rName.append("coordinate"),
                                              sm.getCorLsaSeq())) {
-        std::cout << "Updated Cor LSA. Need to fetch it" << std::endl;
         _LOG_DEBUG("Updated Cor LSA. Need to fetch it");
         ndn::Name interestName(pnlsr.getConfParameter().getLsaPrefix());
         interestName.append(routerName);
@@ -152,9 +142,6 @@
 SyncLogicHandler::publishSyncUpdate(const ndn::Name& updatePrefix,
                                     uint64_t seqNo)
 {
-  std::cout << "Publishing Sync Update ......" << std::endl;
-  std::cout << "Update in prefix: " << updatePrefix << std::endl;
-  std::cout << "Seq No: " << seqNo << std::endl;
   _LOG_DEBUG("Publishing Sync Update. Prefix: " << updatePrefix << "Seq no: " << seqNo);
   ndn::Name updateName(updatePrefix);
   string data("NoData");
diff --git a/src/conf-file-processor.cpp b/src/conf-file-processor.cpp
index a45199b..20a6a68 100644
--- a/src/conf-file-processor.cpp
+++ b/src/conf-file-processor.cpp
@@ -405,7 +405,6 @@
     }
     else {
       std::cerr << "Wrong value for max-faces-per-prefix. ";
-      std::cerr << "NLSR will user default value";
       std::cerr << MAX_FACES_PER_PREFIX_MIN << std::endl;
       return false;
     }
diff --git a/src/conf-parameter.hpp b/src/conf-parameter.hpp
index 25df9ee..a08377c 100644
--- a/src/conf-parameter.hpp
+++ b/src/conf-parameter.hpp
@@ -338,28 +338,6 @@
 
 };
 
-inline std::ostream&
-operator<<(std::ostream& os, ConfParameter& cfp)
-{
-  os << "Router Name: " << cfp.getRouterName() << std::endl;
-  os << "Site Name: " << cfp.getSiteName() << std::endl;
-  os << "Network: " << cfp.getNetwork() << std::endl;
-  os << "Router Prefix: " << cfp.getRouterPrefix() << std::endl;
-  os << "ChronoSync sync Prifex: " << cfp.getChronosyncPrefix() << std::endl;
-  os << "ChronoSync LSA prefix: " << cfp.getLsaPrefix() << std::endl;
-  os << "Interest Retry number: " << cfp.getInterestRetryNumber() << std::endl;
-  os << "Interest Resend second: " << cfp.getInterestResendTime() << std::endl;
-  os << "Info Interest Interval: " << cfp.getInfoInterestInterval() << std::endl;
-  os << "LSA refresh time: " << cfp.getLsaRefreshTime() << std::endl;
-  os << "Max Faces Per Prefix: " << cfp.getMaxFacesPerPrefix() << std::endl;
-  os << "Hyperbolic ROuting: " << cfp.getHyperbolicState() << std::endl;
-  os << "Hyp R: " << cfp.getCorR() << std::endl;
-  os << "Hyp theta: " << cfp.getCorTheta() << std::endl;
-  os << "Log Directory: " << cfp.getLogDir() << std::endl;
-  os << "Seq Directory: " << cfp.getSeqFileDir() << std::endl;
-  return  os;
-}
-
 } // namespace nlsr
 
 #endif //CONF_PARAMETER_HPP
diff --git a/src/hello-protocol.cpp b/src/hello-protocol.cpp
index 91b68a9..506954c 100644
--- a/src/hello-protocol.cpp
+++ b/src/hello-protocol.cpp
@@ -35,7 +35,6 @@
 void
 HelloProtocol::expressInterest(const ndn::Name& interestName, uint32_t seconds)
 {
-  std::cout << "Expressing Interest :" << interestName << std::endl;
   _LOG_DEBUG("Expressing Interest :" << interestName);
   ndn::Interest i(interestName);
   i.setInterestLifetime(ndn::time::seconds(seconds));
@@ -76,14 +75,12 @@
                                const ndn::Interest& interest)
 {
   const ndn::Name interestName = interest.getName();
-  std::cout << "Interest Received for Name: " << interestName << std::endl;
   _LOG_DEBUG("Interest Received for Name: " << interestName);
   if (interestName.get(-2).toUri() != INFO_COMPONENT) {
     return;
   }
   ndn::Name neighbor;
   neighbor.wireDecode(interestName.get(-1).blockFromValue());
-  std::cout << "Neighbor: " << neighbor << std::endl;
   _LOG_DEBUG("Neighbor: " << neighbor);
   if (m_nlsr.getAdjacencyList().isNeighbor(neighbor)) {
     ndn::Data data(ndn::Name(interest.getName()).appendVersion());
@@ -91,7 +88,6 @@
     data.setContent(reinterpret_cast<const uint8_t*>(INFO_COMPONENT.c_str()),
                     INFO_COMPONENT.size());
     m_nlsr.getKeyChain().sign(data, m_nlsr.getDefaultCertName());
-    std::cout << ">> D: " << data << std::endl;
     _LOG_DEBUG("Sending out data for name: " << data.getName());
     m_nlsr.getNlsrFace().put(data);
     int status = m_nlsr.getAdjacencyList().getStatusOfNeighbor(neighbor);
@@ -109,21 +105,16 @@
 HelloProtocol::processInterestTimedOut(const ndn::Interest& interest)
 {
   const ndn::Name interestName(interest.getName());
-  std::cout << "Interest timed out for Name: " << interestName << std::endl;
   _LOG_DEBUG("Interest timed out for Name: " << interestName);
   if (interestName.get(-2).toUri() != INFO_COMPONENT) {
     return;
   }
   ndn::Name neighbor = interestName.getPrefix(-2);
-  std::cout << "Neighbor: " << neighbor << std::endl;
   _LOG_DEBUG("Neighbor: " << neighbor);
   m_nlsr.getAdjacencyList().incrementTimedOutInterestCount(neighbor);
   int status = m_nlsr.getAdjacencyList().getStatusOfNeighbor(neighbor);
   uint32_t infoIntTimedOutCount =
     m_nlsr.getAdjacencyList().getTimedOutInterestCount(neighbor);
-  std::cout << "Neighbor: " << neighbor << std::endl;
-  std::cout << "Status: " << status << std::endl;
-  std::cout << "Info Interest Timed out: " << infoIntTimedOutCount << std::endl;
   _LOG_DEBUG("Status: " << status);
   _LOG_DEBUG("Info Interest Timed out: " << infoIntTimedOutCount);
   if ((infoIntTimedOutCount < m_nlsr.getConfParameter().getInterestRetryNumber())) {
@@ -161,35 +152,19 @@
 HelloProtocol::onContentValidated(const ndn::shared_ptr<const ndn::Data>& data)
 {
   ndn::Name dataName = data->getName();
-  std::cout << "Data received for name: " << dataName << std::endl;
   _LOG_DEBUG("Data received for name: " << dataName);
   if (dataName.get(-3).toUri() == INFO_COMPONENT) {
     ndn::Name neighbor = dataName.getPrefix(-3);
     int oldStatus = m_nlsr.getAdjacencyList().getStatusOfNeighbor(neighbor);
-    int infoIntTimedOutCount = m_nlsr.getAdjacencyList().getTimedOutInterestCount(
-                                 neighbor);
-    //debugging purpose start
-    std::cout << "Before Updates: " << std::endl;
-    std::cout << "Neighbor : " << neighbor << std::endl;
-    std::cout << "Status: " << oldStatus << std::endl;
-    std::cout << "Info Interest Timed out: " << infoIntTimedOutCount << std::endl;
-    //debugging purpose end
     m_nlsr.getAdjacencyList().setStatusOfNeighbor(neighbor, 1);
     m_nlsr.getAdjacencyList().setTimedOutInterestCount(neighbor, 0);
     int newStatus = m_nlsr.getAdjacencyList().getStatusOfNeighbor(neighbor);
-    infoIntTimedOutCount = m_nlsr.getAdjacencyList().getTimedOutInterestCount(
-                             neighbor);
-    //debugging purpose
-    std::cout << "After Updates: " << std::endl;
-    std::cout << "Neighbor : " << neighbor << std::endl;
-    std::cout << "Status: " << newStatus << std::endl;
-    std::cout << "Info Interest Timed out: " << infoIntTimedOutCount << std::endl;
+    _LOG_DEBUG("Neighbor : " << neighbor);
     _LOG_DEBUG("Old Status: " << oldStatus << " New Status: " << newStatus);
-    //debugging purpose end
     // change in Adjacency list
     if ((oldStatus - newStatus) != 0) {
       m_nlsr.incrementAdjBuildCount();
-      /* Need to schedule event for Adjacency LSA building */
+      // Need to schedule event for Adjacency LSA building
       if (m_nlsr.getIsBuildAdjLsaSheduled() == false) {
         _LOG_DEBUG("Scheduling scheduledAdjLsaBuild");
         m_nlsr.setIsBuildAdjLsaSheduled(true);
diff --git a/src/lsa.cpp b/src/lsa.cpp
index 9c3bf44..2e933ce 100644
--- a/src/lsa.cpp
+++ b/src/lsa.cpp
@@ -124,28 +124,9 @@
   {
     _LOG_DEBUG("    Name " << i << ": " << (*it));
   }
+  _LOG_DEBUG("name_lsa_end");
 }
 
-std::ostream&
-operator<<(std::ostream& os, NameLsa& nLsa)
-{
-  os << "Name Lsa: " << endl;
-  os << "  Origination Router: " << nLsa.getOrigRouter() << endl;
-  os << "  Ls Type: " << nLsa.getLsType() << endl;
-  os << "  Ls Seq No: " << nLsa.getLsSeqNo() << endl;
-  os << "  Ls Lifetime: " << nLsa.getExpirationTimePoint() << endl;
-  os << "  Names: " << endl;
-  int i = 1;
-  std::list<ndn::Name> nl = nLsa.getNpl().getNameList();
-  for (std::list<ndn::Name>::iterator it = nl.begin(); it != nl.end(); it++)
-  {
-    os << "    Name " << i << ": " << (*it) << endl;
-  }
-  return os;
-}
-
-
-
 CoordinateLsa::CoordinateLsa(const ndn::Name& origR, const string lst,
                              uint32_t lsn,
                              const ndn::time::system_clock::TimePoint& lt,
@@ -226,20 +207,6 @@
   _LOG_DEBUG("    Hyperbolic Theta: " << m_corRad);
 }
 
-std::ostream&
-operator<<(std::ostream& os, const CoordinateLsa& cLsa)
-{
-  os << "Cor Lsa: " << endl;
-  os << "  Origination Router: " << cLsa.getOrigRouter() << endl;
-  os << "  Ls Type: " << cLsa.getLsType() << endl;
-  os << "  Ls Seq No: " << cLsa.getLsSeqNo() << endl;
-  os << "  Ls Lifetime: " << cLsa.getExpirationTimePoint() << endl;
-  os << "    Hyperbolic Radius: " << cLsa.getCorRadius() << endl;
-  os << "    Hyperbolic Theta: " << cLsa.getCorTheta() << endl;
-  return os;
-}
-
-
 AdjLsa::AdjLsa(const ndn::Name& origR, const string& lst, uint32_t lsn,
                const ndn::time::system_clock::TimePoint& lt,
                uint32_t nl , AdjacencyList& adl)
@@ -365,28 +332,7 @@
     _LOG_DEBUG("      Connecting FaceUri: " << (*it).getConnectingFaceUri());
     _LOG_DEBUG("      Link Cost: " << (*it).getLinkCost());
   }
-}
-
-std::ostream&
-operator<<(std::ostream& os, AdjLsa& aLsa)
-{
-  os << "Adj Lsa: " << endl;
-  os << "  Origination Router: " << aLsa.getOrigRouter() << endl;
-  os << "  Ls Type: " << aLsa.getLsType() << endl;
-  os << "  Ls Seq No: " << aLsa.getLsSeqNo() << endl;
-  os << "  Ls Lifetime: " << aLsa.getExpirationTimePoint() << endl;
-  os << "  No Link: " << aLsa.getNoLink() << endl;
-  os << "  Adjacents: " << endl;
-  int i = 1;
-  std::list<Adjacent> al = aLsa.getAdl().getAdjList();
-  for (std::list<Adjacent>::iterator it = al.begin(); it != al.end(); it++)
-  {
-    os << "    Adjacent " << i << ": " << endl;
-    os << "      Adjacent Name: " << (*it).getName() << endl;
-    os << "      Connecting FaceUri: " << (*it).getConnectingFaceUri() << endl;
-    os << "      Link Cost: " << (*it).getLinkCost() << endl;
-  }
-  return os;
+  _LOG_DEBUG("adj_lsa_end");
 }
 
 }//namespace nlsr
diff --git a/src/lsa.hpp b/src/lsa.hpp
index ed0d870..2137069 100644
--- a/src/lsa.hpp
+++ b/src/lsa.hpp
@@ -162,9 +162,6 @@
 
 };
 
-std::ostream&
-operator<<(std::ostream& os, NameLsa& nLsa);
-
 class AdjLsa: public Lsa
 {
 public:
@@ -223,9 +220,6 @@
   AdjacencyList m_adl;
 };
 
-std::ostream&
-operator<<(std::ostream& os, AdjLsa& aLsa);
-
 class CoordinateLsa: public Lsa
 {
 public:
@@ -286,10 +280,6 @@
 
 };
 
-std::ostream&
-operator<<(std::ostream& os, const CoordinateLsa& cLsa);
-
-
 }//namespace nlsr
 
 #endif //NLSR_LSA_HPP
diff --git a/src/lsdb.cpp b/src/lsdb.cpp
index bb1150e..16e7d1a 100644
--- a/src/lsdb.cpp
+++ b/src/lsdb.cpp
@@ -103,10 +103,10 @@
   NameLsa* chkNameLsa = findNameLsa(nlsa.getKey());
   if (chkNameLsa == 0) {
     addNameLsa(nlsa);
-    _LOG_DEBUG("New Name LSA. Adding to LSDB");
+    _LOG_DEBUG("New Name LSA");
+    _LOG_DEBUG("Adding Name Lsa");
     nlsa.writeLog();
 
-    printNameLsdb();
     if (nlsa.getOrigRouter() != m_nlsr.getConfParameter().getRouterPrefix()) {
       m_nlsr.getNamePrefixTable().addEntry(nlsa.getOrigRouter(),
                                            nlsa.getOrigRouter());
@@ -130,7 +130,7 @@
   else {
     if (chkNameLsa->getLsSeqNo() < nlsa.getLsSeqNo()) {
       _LOG_DEBUG("Updated Name LSA. Updating LSDB");
-      _LOG_DEBUG("Old Name LSA ");
+      _LOG_DEBUG("Deleting Name Lsa");
       chkNameLsa->writeLog();
       chkNameLsa->setLsSeqNo(nlsa.getLsSeqNo());
       chkNameLsa->setExpirationTimePoint(nlsa.getExpirationTimePoint());
@@ -175,7 +175,7 @@
       chkNameLsa->setExpiringEventId(scheduleNameLsaExpiration(nlsa.getKey(),
                                                                nlsa.getLsSeqNo(),
                                                                timeToExpire));
-      _LOG_DEBUG("Updated Name LSA");
+      _LOG_DEBUG("Adding Name Lsa");
       chkNameLsa->writeLog();
     }
   }
@@ -203,7 +203,7 @@
                                                  m_nameLsdb.end(),
                                                  ndn::bind(nameLsaCompareByKey, _1, key));
   if (it != m_nameLsdb.end()) {
-    _LOG_DEBUG("Removing Name LSA");
+    _LOG_DEBUG("Deleting Name Lsa");
     (*it).writeLog();
     if ((*it).getOrigRouter() !=
         m_nlsr.getConfParameter().getRouterPrefix()) {
@@ -235,18 +235,17 @@
 }
 
 void
-Lsdb::printNameLsdb()
+Lsdb::writeNameLsdbLog()
 {
-  cout << "---------------Name LSDB-------------------" << endl;
+  _LOG_DEBUG("---------------Name LSDB-------------------");
   for (std::list<NameLsa>::iterator it = m_nameLsdb.begin();
        it != m_nameLsdb.end() ; it++) {
-    cout << (*it) << endl;
+    (*it).writeLog();
   }
 }
 
 // Cor LSA and LSDB related Functions start here
 
-
 static bool
 corLsaCompareByKey(const CoordinateLsa& clsa, const ndn::Name& key)
 {
@@ -310,10 +309,10 @@
   CoordinateLsa* chkCorLsa = findCoordinateLsa(clsa.getKey());
   if (chkCorLsa == 0) {
     _LOG_DEBUG("New Coordinate LSA. Adding to LSDB");
+    _LOG_DEBUG("Adding Coordinate Lsa");
     clsa.writeLog();
     addCoordinateLsa(clsa);
-    //debugging purpose
-    printCorLsdb();
+
     if (clsa.getOrigRouter() != m_nlsr.getConfParameter().getRouterPrefix()) {
       m_nlsr.getNamePrefixTable().addEntry(clsa.getOrigRouter(),
                                            clsa.getOrigRouter());
@@ -332,7 +331,7 @@
   else {
     if (chkCorLsa->getLsSeqNo() < clsa.getLsSeqNo()) {
       _LOG_DEBUG("Updated Coordinate LSA. Updating LSDB");
-      _LOG_DEBUG("Old Coordinate LSA");
+      _LOG_DEBUG("Deleting Coordinate Lsa");
       chkCorLsa->writeLog();
       chkCorLsa->setLsSeqNo(clsa.getLsSeqNo());
       chkCorLsa->setExpirationTimePoint(clsa.getExpirationTimePoint());
@@ -352,7 +351,7 @@
       chkCorLsa->setExpiringEventId(scheduleCoordinateLsaExpiration(clsa.getKey(),
                                                                     clsa.getLsSeqNo(),
                                                                     timeToExpire));
-      _LOG_DEBUG("Updated Coordinate LSA");
+      _LOG_DEBUG("Adding Coordinate Lsa");
       chkCorLsa->writeLog();
     }
   }
@@ -381,7 +380,7 @@
                                                        ndn::bind(corLsaCompareByKey,
                                                                  _1, key));
   if (it != m_corLsdb.end()) {
-    _LOG_DEBUG("Removing Coordinate LSA");
+    _LOG_DEBUG("Deleting Coordinate Lsa");
     (*it).writeLog();
     if ((*it).getOrigRouter() !=
         m_nlsr.getConfParameter().getRouterPrefix()) {
@@ -407,18 +406,16 @@
   return true;
 }
 
-//debugging
 void
-Lsdb::printCorLsdb()
+Lsdb::writeCorLsdbLog()
 {
-  cout << "---------------Cor LSDB-------------------" << endl;
+  _LOG_DEBUG("---------------Cor LSDB-------------------");
   for (std::list<CoordinateLsa>::iterator it = m_corLsdb.begin();
        it != m_corLsdb.end() ; it++) {
-    cout << (*it) << endl;
+    (*it).writeLog();
   }
 }
 
-
 // Adj LSA and LSDB related function starts here
 
 static bool
@@ -427,11 +424,9 @@
   return alsa.getKey() == key;
 }
 
-
 void
 Lsdb::scheduledAdjLsaBuild()
 {
-  std::cout << "scheduledAdjLsaBuild Called" << endl;
   _LOG_DEBUG("scheduledAdjLsaBuild Called");
   m_nlsr.setIsBuildAdjLsaSheduled(false);
   if (m_nlsr.getAdjacencyList().isAdjLsaBuildable(m_nlsr)) {
@@ -520,6 +515,7 @@
   AdjLsa* chkAdjLsa = findAdjLsa(alsa.getKey());
   if (chkAdjLsa == 0) {
     _LOG_DEBUG("New Adj LSA. Adding to LSDB");
+    _LOG_DEBUG("Adding Adj Lsa");
     alsa.writeLog();
     addAdjLsa(alsa);
     alsa.addNptEntries(m_nlsr);
@@ -535,7 +531,7 @@
   else {
     if (chkAdjLsa->getLsSeqNo() < alsa.getLsSeqNo()) {
       _LOG_DEBUG("Updated Adj LSA. Updating LSDB");
-      _LOG_DEBUG("Old Adj LSA");
+      _LOG_DEBUG("Deleting Adj Lsa");
       chkAdjLsa->writeLog();
       chkAdjLsa->setLsSeqNo(alsa.getLsSeqNo());
       chkAdjLsa->setExpirationTimePoint(alsa.getExpirationTimePoint());
@@ -553,7 +549,7 @@
       chkAdjLsa->setExpiringEventId(scheduleAdjLsaExpiration(alsa.getKey(),
                                                              alsa.getLsSeqNo(),
                                                              timeToExpire));
-      _LOG_DEBUG("Updated Adj LSA");
+      _LOG_DEBUG("Adding Adj Lsa");
       chkAdjLsa->writeLog();
     }
   }
@@ -585,7 +581,7 @@
                                                 m_adjLsdb.end(),
                                                 ndn::bind(adjLsaCompareByKey, _1, key));
   if (it != m_adjLsdb.end()) {
-    _LOG_DEBUG("Removing Adj LSA");
+    _LOG_DEBUG("Deleting Adj Lsa");
     (*it).writeLog();
     (*it).removeNptEntries(m_nlsr);
     m_adjLsdb.erase(it);
@@ -627,22 +623,20 @@
 void
 Lsdb::exprireOrRefreshNameLsa(const ndn::Name& lsaKey, uint64_t seqNo)
 {
-  std::cout << "Lsdb::exprireOrRefreshNameLsa Called " << std::endl;
-  std::cout << "LSA Key : " << lsaKey << " Seq No: " << seqNo << std::endl;
   _LOG_DEBUG("Lsdb::exprireOrRefreshNameLsa Called");
   _LOG_DEBUG("LSA Key : " << lsaKey << " Seq No: " << seqNo);
   NameLsa* chkNameLsa = findNameLsa(lsaKey);
   if (chkNameLsa != 0) {
-    std::cout << "LSA Exists with seq no: " << chkNameLsa->getLsSeqNo() << std::endl;
     _LOG_DEBUG("LSA Exists with seq no: " << chkNameLsa->getLsSeqNo());
     if (chkNameLsa->getLsSeqNo() == seqNo) {
       if (chkNameLsa->getOrigRouter() == m_thisRouterPrefix) {
+        _LOG_DEBUG("Own Name LSA, so refreshing it");
+        _LOG_DEBUG("Deleting Name Lsa");
         chkNameLsa->writeLog();
-        std::cout << "Own Name LSA, so refreshing name LSA" << std::endl;
-        _LOG_DEBUG("Own Name LSA, so refreshing name LSA");
         chkNameLsa->setLsSeqNo(chkNameLsa->getLsSeqNo() + 1);
         m_nlsr.getSequencingManager().setNameLsaSeq(chkNameLsa->getLsSeqNo());
         chkNameLsa->setExpirationTimePoint(getLsaExpirationTimePoint());
+        _LOG_DEBUG("Adding Name Lsa");
         chkNameLsa->writeLog();
         // schedule refreshing event again
         chkNameLsa->setExpiringEventId(scheduleNameLsaExpiration(chkNameLsa->getKey(),
@@ -655,7 +649,6 @@
                                                           lsaPrefix);
       }
       else {
-        std::cout << "Other's Name LSA, so removing form LSDB" << std::endl;
         _LOG_DEBUG("Other's Name LSA, so removing form LSDB");
         removeNameLsa(lsaKey);
       }
@@ -666,21 +659,21 @@
 void
 Lsdb::exprireOrRefreshAdjLsa(const ndn::Name& lsaKey, uint64_t seqNo)
 {
-  cout << "Lsdb::exprireOrRefreshAdjLsa Called " << endl;
-  cout << "LSA Key : " << lsaKey << " Seq No: " << seqNo << endl;
   _LOG_DEBUG("Lsdb::exprireOrRefreshAdjLsa Called");
   _LOG_DEBUG("LSA Key : " << lsaKey << " Seq No: " << seqNo);
   AdjLsa* chkAdjLsa = findAdjLsa(lsaKey);
   if (chkAdjLsa != 0) {
-    cout << "LSA Exists with seq no: " << chkAdjLsa->getLsSeqNo() << endl;
-    _LOG_DEBUG("LSA Exists with seq no: ");
+    _LOG_DEBUG("LSA Exists with seq no: " << chkAdjLsa->getLsSeqNo());
     if (chkAdjLsa->getLsSeqNo() == seqNo) {
       if (chkAdjLsa->getOrigRouter() == m_thisRouterPrefix) {
-        cout << "Own Adj LSA, so refreshing Adj LSA" << endl;
-        _LOG_DEBUG("Own Adj LSA, so refreshing Adj LSA");
+        _LOG_DEBUG("Own Adj LSA, so refreshing it");
+        _LOG_DEBUG("Deleting Adj Lsa");
+        chkAdjLsa->writeLog();
         chkAdjLsa->setLsSeqNo(chkAdjLsa->getLsSeqNo() + 1);
         m_nlsr.getSequencingManager().setAdjLsaSeq(chkAdjLsa->getLsSeqNo());
         chkAdjLsa->setExpirationTimePoint(getLsaExpirationTimePoint());
+        _LOG_DEBUG("Adding Adj Lsa");
+        chkAdjLsa->writeLog();
         // schedule refreshing event again
         chkAdjLsa->setExpiringEventId(scheduleAdjLsaExpiration(chkAdjLsa->getKey(),
                                                                chkAdjLsa->getLsSeqNo(),
@@ -692,7 +685,6 @@
                                                           lsaPrefix);
       }
       else {
-        cout << "Other's Adj LSA, so removing form LSDB" << endl;
         _LOG_DEBUG("Other's Adj LSA, so removing form LSDB");
         removeAdjLsa(lsaKey);
       }
@@ -706,21 +698,21 @@
 Lsdb::exprireOrRefreshCoordinateLsa(const ndn::Name& lsaKey,
                                     uint64_t seqNo)
 {
-  cout << "Lsdb::exprireOrRefreshCorLsa Called " << endl;
-  cout << "LSA Key : " << lsaKey << " Seq No: " << seqNo << endl;
   _LOG_DEBUG("Lsdb::exprireOrRefreshCorLsa Called ");
   _LOG_DEBUG("LSA Key : " << lsaKey << " Seq No: " << seqNo);
   CoordinateLsa* chkCorLsa = findCoordinateLsa(lsaKey);
   if (chkCorLsa != 0) {
-    cout << " LSA Exists with seq no: " << chkCorLsa->getLsSeqNo() << endl;
     _LOG_DEBUG("LSA Exists with seq no: " << chkCorLsa->getLsSeqNo());
     if (chkCorLsa->getLsSeqNo() == seqNo) {
       if (chkCorLsa->getOrigRouter() == m_thisRouterPrefix) {
-        cout << "Own Cor LSA, so refreshing Cor LSA" << endl;
-        _LOG_DEBUG("Own Cor LSA, so refreshing Cor LSA");
+        _LOG_DEBUG("Own Cor LSA, so refreshing it");
+        _LOG_DEBUG("Deleting Coordinate Lsa");
+        chkCorLsa->writeLog();
         chkCorLsa->setLsSeqNo(chkCorLsa->getLsSeqNo() + 1);
         m_nlsr.getSequencingManager().setCorLsaSeq(chkCorLsa->getLsSeqNo());
         chkCorLsa->setExpirationTimePoint(getLsaExpirationTimePoint());
+        _LOG_DEBUG("Adding Coordinate Lsa");
+        chkCorLsa->writeLog();
         // schedule refreshing event again
         chkCorLsa->setExpiringEventId(scheduleCoordinateLsaExpiration(
                                         chkCorLsa->getKey(),
@@ -733,7 +725,6 @@
                                                           lsaPrefix);
       }
       else {
-        cout << "Other's Cor LSA, so removing form LSDB" << endl;
         _LOG_DEBUG("Other's Cor LSA, so removing form LSDB");
         removeCoordinateLsa(lsaKey);
       }
@@ -749,7 +740,6 @@
 Lsdb::expressInterest(const ndn::Name& interestName, uint32_t interestLifeTime,
                       uint32_t timeoutCount)
 {
-  std::cout << "Expressing Interest :" << interestName << std::endl;
   _LOG_DEBUG("Expressing Interest for LSA(name): " << interestName);
   ndn::Interest interest(interestName);
   interest.setInterestLifetime(ndn::time::seconds(interestLifeTime));
@@ -765,7 +755,6 @@
 Lsdb::processInterest(const ndn::Name& name, const ndn::Interest& interest)
 {
   const ndn::Name& intName(interest.getName());
-  std::cout << "Interest recevied for LSA: " << intName << std::endl;
   _LOG_DEBUG("Interest recevied for LSA(name): " << intName);
   string chkString("LSA");
   int32_t lsaPosition = util::getNameComponentPosition(interest.getName(),
@@ -777,10 +766,6 @@
                                               interest.getName().size() - lsaPosition - 3);
     interestedLsType  = intName[-2].toUri();
     interestedLsSeqNo = intName[-1].toNumber();
-    std::cout << "Router Name: " << origRouter << std::endl;
-    std::cout << "Ls Type    : " << interestedLsType << std::endl;
-    std::cout << "Ls Seq     : " << interestedLsSeqNo << endl;
-    std::cout << "Ls Type: " << interestedLsType << std::endl;
     if (interestedLsType == "name") {
       processInterestForNameLsa(interest,
                                 origRouter.append(interestedLsType),
@@ -800,7 +785,7 @@
       return;
     }
     else {
-      cout << "Unrecognized LSA Type :(" << endl;
+      _LOG_DEBUG("Unrecognized LSA Type :(");
     }
   }
 }
@@ -878,7 +863,6 @@
 Lsdb::onContentValidated(const ndn::shared_ptr<const ndn::Data>& data)
 {
   const ndn::Name& dataName = data->getName();
-  std::cout << "Data received for name: " << dataName << std::endl;
   _LOG_DEBUG("Data received for LSA(name): " << dataName);
   string dataContent(reinterpret_cast<const char*>(data->getContent().value()));
   string chkString("LSA");
@@ -890,9 +874,6 @@
                                                dataName.size() - lsaPosition - 4);
     interestedLsType  = dataName[-3].toUri();
     interestedLsSeqNo = dataName[-2].toNumber();
-    std::cout << "Ls Type    : " << interestedLsType << std::endl;
-    std::cout << "Ls Seq     : " << interestedLsSeqNo << std::endl;
-    std::cout << "Ls Type: " << interestedLsType << std::endl;
     if (interestedLsType == "name") {
       processContentNameLsa(origRouter.append(interestedLsType),
                             interestedLsSeqNo, dataContent);
@@ -909,7 +890,7 @@
       return;
     }
     else {
-      cout << "Unrecognized LSA Type :(" << endl;
+      _LOG_DEBUG("Unrecognized LSA Type :(");
     }
   }
 }
@@ -917,7 +898,7 @@
 void
 Lsdb::onContentValidationFailed(const ndn::shared_ptr<const ndn::Data>& data, const std::string& msg)
 {
-  std::cerr << "Validation Error: " << msg << std::endl;
+  _LOG_DEBUG("Validation Error: " << msg);
 }
 
 void
@@ -930,7 +911,7 @@
       installNameLsa(nameLsa);
     }
     else {
-      std::cout << "LSA data decoding error :(" << std::endl;
+      _LOG_DEBUG("LSA data decoding error :(");
     }
   }
 }
@@ -945,7 +926,7 @@
       installAdjLsa(adjLsa);
     }
     else {
-      std::cout << "LSA data decoding error :(" << std::endl;
+      _LOG_DEBUG("LSA data decoding error :(");
     }
   }
 }
@@ -960,7 +941,7 @@
       installCoordinateLsa(corLsa);
     }
     else {
-      std::cout << "LSA data decoding error :(" << std::endl;
+      _LOG_DEBUG("LSA data decoding error :(");
     }
   }
 }
@@ -989,12 +970,12 @@
 }
 
 void
-Lsdb::printAdjLsdb()
+Lsdb::writeAdjLsdbLog()
 {
-  cout << "---------------Adj LSDB-------------------" << endl;
+  _LOG_DEBUG("---------------Adj LSDB-------------------");
   for (std::list<AdjLsa>::iterator it = m_adjLsdb.begin();
        it != m_adjLsdb.end() ; it++) {
-    cout << (*it) << endl;
+    (*it).writeLog();
   }
 }
 
diff --git a/src/lsdb.hpp b/src/lsdb.hpp
index 79d6e2c..7c6ceb1 100644
--- a/src/lsdb.hpp
+++ b/src/lsdb.hpp
@@ -62,9 +62,8 @@
   bool
   isNameLsaNew(const ndn::Name& key, uint64_t seqNo);
 
-  //debugging
   void
-  printNameLsdb();
+  writeNameLsdbLog();
 
   //function related to Cor LSDB
   bool
@@ -82,9 +81,8 @@
   bool
   isCoordinateLsaNew(const ndn::Name& key, uint64_t seqNo);
 
-  //debugging
   void
-  printCorLsdb();
+  writeCorLsdbLog();
 
   //function related to Adj LSDB
   void
@@ -108,9 +106,8 @@
   getAdjLsdb();
 
   void
-  printAdjLsdb();
+  writeAdjLsdbLog();
 
-  //void scheduleRefreshLsdb(Nlsr& pnlsr, int interval);
   void
   setLsaRefreshTime(int lrt);
 
diff --git a/src/name-prefix-list.cpp b/src/name-prefix-list.cpp
index 8238732..0be579f 100644
--- a/src/name-prefix-list.cpp
+++ b/src/name-prefix-list.cpp
@@ -93,15 +93,4 @@
   }
 }
 
-void
-NamePrefixList::print()
-{
-  int i = 1;
-  for (std::list<ndn::Name>::iterator it = m_nameList.begin();
-       it != m_nameList.end(); it++) {
-    cout << "Name " << i << " : " << (*it) << endl;
-    i++;
-  }
-}
-
 }//namespace nlsr
diff --git a/src/name-prefix-list.hpp b/src/name-prefix-list.hpp
index 8d8b1c1..9f50d2e 100644
--- a/src/name-prefix-list.hpp
+++ b/src/name-prefix-list.hpp
@@ -62,9 +62,6 @@
   void
   writeLog();
 
-  void
-  print();
-
 private:
   std::list<ndn::Name> m_nameList;
 
diff --git a/src/nlsr.cpp b/src/nlsr.cpp
index 02a366b..9084d7c 100644
--- a/src/nlsr.cpp
+++ b/src/nlsr.cpp
@@ -104,11 +104,6 @@
   m_fib.setEntryRefreshTime(2 * m_confParam.getLsaRefreshTime());
   m_sequencingManager.setSeqFileName(m_confParam.getSeqFileDir());
   m_sequencingManager.initiateSeqNoFromFile();
-  /* debugging purpose start */
-  cout << m_confParam;
-  m_adjacencyList.print();
-  m_namePrefixList.print();
-  /* debugging purpose end */
   /* Logging start */
   m_confParam.writeLog();
   m_adjacencyList.writeLog();
diff --git a/src/route/face-map.cpp b/src/route/face-map.cpp
new file mode 100644
index 0000000..7251fc5
--- /dev/null
+++ b/src/route/face-map.cpp
@@ -0,0 +1,44 @@
+/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
+/**
+ * Copyright (c) 2014  University of Memphis,
+ *                     Regents of the University of California
+ *
+ * This file is part of NLSR (Named-data Link State Routing).
+ * See AUTHORS.md for complete list of NLSR authors and contributors.
+ *
+ * NLSR is free software: you can redistribute it and/or modify it under the terms
+ * of the GNU General Public License as published by the Free Software Foundation,
+ * either version 3 of the License, or (at your option) any later version.
+ *
+ * NLSR is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
+ * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
+ * PURPOSE.  See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along with
+ * NLSR, e.g., in COPYING.md file.  If not, see <http://www.gnu.org/licenses/>.
+ *
+ * \author A K M Mahmudul Hoque <ahoque1@memphis.edu>
+ *
+ **/
+#include <iostream>
+#include <list>
+#include <utility>
+#include "logger.hpp"
+#include "face-map.hpp"
+
+namespace nlsr {
+
+INIT_LOGGER("FaceMap");
+
+void
+FaceMap::writeLog()
+{
+  _LOG_DEBUG("------- Face Map-----------");
+  for(std::list<FaceMapEntry>::iterator it = m_table.begin();
+      it != m_table.end(); ++it) {
+    _LOG_DEBUG("Face Map Entry (FaceUri: " << (*it).getFaceUri() << " Face Id: "
+               << (*it).getFaceId() << ")");
+  }
+}
+
+} // namespace NLSR
diff --git a/src/route/face-map.hpp b/src/route/face-map.hpp
index 2225446..4bc2b68 100644
--- a/src/route/face-map.hpp
+++ b/src/route/face-map.hpp
@@ -23,6 +23,8 @@
 #ifndef NLSR_FACE_MAP_HPP
 #define NLSR_FACE_MAP_HPP
 
+#include <ndn-cxx/common.hpp>
+
 namespace nlsr {
 
 class FaceMapEntry {
@@ -69,14 +71,6 @@
   uint32_t m_faceId;
 };
 
-inline std::ostream&
-operator<<(std::ostream& os, const FaceMapEntry& fme)
-{
-  os << "Face Map Entry (FaceUri: " << fme.getFaceUri() << " Face Id: ";
-  os << fme.getFaceId() << ")" << std::endl;
-  return os;
-}
-
 class FaceMap {
 
 public:
@@ -118,15 +112,8 @@
     return 0;
   }
 
-  inline void
-  print()
-  {
-    std::cout << "------- Face Map-----------" << std::endl;
-    for(std::list<FaceMapEntry>::iterator it = m_table.begin();
-        it != m_table.end(); ++it) {
-          std::cout << (*it);
-    }
-  }
+  void
+  writeLog();
 
 private:
   std::list<FaceMapEntry> m_table;
diff --git a/src/route/fib-entry.cpp b/src/route/fib-entry.cpp
index aacb0a3..a7eb68f 100644
--- a/src/route/fib-entry.cpp
+++ b/src/route/fib-entry.cpp
@@ -64,13 +64,4 @@
   m_nexthopList.writeLog();
 }
 
-ostream&
-operator<<(ostream& os, FibEntry fe)
-{
-  os << "Name Prefix: " << fe.getName() << endl;
-  os << "Time to Refresh: " << fe.getExpirationTimePoint() << endl;
-  os << fe.getNexthopList() << endl;
-  return os;
-}
-
 }//namespace nlsr
diff --git a/src/route/fib-entry.hpp b/src/route/fib-entry.hpp
index 5465ec9..7f39fdd 100644
--- a/src/route/fib-entry.hpp
+++ b/src/route/fib-entry.hpp
@@ -116,9 +116,6 @@
   NexthopList m_nexthopList;
 };
 
-std::ostream&
-operator<<(std::ostream& os, FibEntry fe);
-
 } //namespace nlsr
 
 #endif //NLSR_FIB_ENTRY_HPP
diff --git a/src/route/fib.cpp b/src/route/fib.cpp
index 1460dbb..8b5d668 100644
--- a/src/route/fib.cpp
+++ b/src/route/fib.cpp
@@ -56,8 +56,6 @@
 Fib::scheduleEntryRefreshing(const ndn::Name& name, int32_t feSeqNum,
                              const ndn::time::seconds& expTime)
 {
-  std::cout << "Fib::scheduleEntryRefreshing Called" << std::endl;
-  std::cout << "Name: " << name << " Seq Num: " << feSeqNum << std::endl;
   _LOG_DEBUG("Fib::scheduleEntryRefreshing Called");
   _LOG_DEBUG("Name: " << name << " Seq Num: " << feSeqNum);
   return m_nlsr.getScheduler().scheduleEvent(expTime,
@@ -68,15 +66,13 @@
 void
 Fib::refreshEntry(const ndn::Name& name, int32_t feSeqNum)
 {
-  std::cout << "Fib::refreshEntry Called" << std::endl;
-  std::cout << "Name: " << name << " Seq Num: " << feSeqNum << std::endl;
+  _LOG_DEBUG("Fib::refreshEntry Called");
+  _LOG_DEBUG("Name: " << name << " Seq Num: " << feSeqNum);
   std::list<FibEntry>::iterator it = std::find_if(m_table.begin(),
                                                   m_table.end(),
                                                   bind(&fibEntryNameCompare, _1, name));
   if (it != m_table.end()) {
-    std::cout << "Entry found with Seq Num: " << feSeqNum << std::endl;
     if (it->getSeqNo() == feSeqNum) {
-      std::cout << "Refreshing the FIB entry" << std::endl;
       _LOG_DEBUG("Refreshing the FIB entry. Name: " <<  name);
       for (std::list<NextHop>::iterator nhit =
              (*it).getNexthopList().getNextHops().begin();
@@ -117,8 +113,6 @@
         }
       }
     }
-    std::cout << "Cancellling Scheduled event" << std::endl;
-    std::cout << "Name: " << name << "Seq num: " << it->getSeqNo() << std::endl;
     _LOG_DEBUG("Cancelling Scheduled event. Name: " << name);
     cancelScheduledExpiringEvent((*it).getExpiringEventId());
     m_table.erase(it);
@@ -129,7 +123,6 @@
 void
 Fib::update(const ndn::Name& name, NexthopList& nextHopList)
 {
-  std::cout << "Fib::updateFib Called" << std::endl;
   _LOG_DEBUG("Fib::updateFib Called");
   int startFace = 0;
   int endFace = getNumberOfFacesForName(nextHopList,
@@ -160,7 +153,7 @@
     }
   }
   else {
-    std::cout << "Old FIB Entry" << std::endl;
+    _LOG_DEBUG("Old FIB Entry");
     if (nextHopList.getSize() > 0) {
       nextHopList.sort();
       if (!it->isEqualNextHops(nextHopList)) {
@@ -184,8 +177,6 @@
       ndn::time::system_clock::TimePoint expirationTimePoint = ndn::time::system_clock::now();
       expirationTimePoint = expirationTimePoint + ndn::time::seconds(m_refreshTime);
       it->setExpirationTimePoint(expirationTimePoint);
-      std::cout << "Cancellling Scheduled event" << std::endl;
-      std::cout << "Name: " << name << "Seq num: " << it->getSeqNo() << std::endl;
       _LOG_DEBUG("Cancelling Scheduled event. Name: " << name);
       cancelScheduledExpiringEvent(it->getExpiringEventId());
       it->setSeqNo(it->getSeqNo() + 1);
@@ -207,9 +198,6 @@
   _LOG_DEBUG("Fib::clean called");
   for (std::list<FibEntry>::iterator it = m_table.begin(); it != m_table.end();
        ++it) {
-    std::cout << "Cancellling Scheduled event" << std::endl;
-    std::cout << "Name: " << it->getName() << "Seq num: " << it->getSeqNo() <<
-              std::endl;
     _LOG_DEBUG("Cancelling Scheduled event. Name: " << it->getName());
     cancelScheduledExpiringEvent((*it).getExpiringEventId());
     for (std::list<NextHop>::iterator nhit =
@@ -339,9 +327,8 @@
 Fib::onRegistration(const ndn::nfd::ControlParameters& commandSuccessResult,
                     const std::string& message, const std::string& faceUri)
 {
-  //std::cout << message << ": " << commandSuccessResult << std::endl;
   m_faceMap.update(faceUri, commandSuccessResult.getFaceId());
-  m_faceMap.print();
+  m_faceMap.writeLog();
 }
 
 
@@ -349,14 +336,13 @@
 Fib::onSuccess(const ndn::nfd::ControlParameters& commandSuccessResult,
                const std::string& message)
 {
-  //std::cout << message << ": " << commandSuccessResult << std::endl;
 }
 
 void
 Fib::onFailure(uint32_t code, const std::string& error,
                const std::string& message)
 {
-  std::cout << message << ": " << error << " (code: " << code << ")";
+  _LOG_DEBUG(message << ": " << error << " (code: " << code << ")");
 }
 
 void
@@ -369,14 +355,4 @@
   }
 }
 
-void
-Fib::print()
-{
-  cout << "-------------------FIB-----------------------------" << endl;
-  for (std::list<FibEntry>::iterator it = m_table.begin(); it != m_table.end();
-       ++it) {
-    cout << (*it);
-  }
-}
-
 } //namespace nlsr
diff --git a/src/route/fib.hpp b/src/route/fib.hpp
index b44c86d..9ffd44c 100644
--- a/src/route/fib.hpp
+++ b/src/route/fib.hpp
@@ -66,9 +66,6 @@
     m_refreshTime = fert;
   }
 
-  void
-  print();
-
 private:
   void
   removeHop(NexthopList& nl, const std::string& doNotRemoveHopFaceUri,
diff --git a/src/route/map-entry.hpp b/src/route/map-entry.hpp
index f2ba05d..f3779e9 100644
--- a/src/route/map-entry.hpp
+++ b/src/route/map-entry.hpp
@@ -64,14 +64,6 @@
   int32_t m_mappingNumber;
 };
 
-inline std::ostream&
-operator<<(std::ostream& os, const MapEntry& mpe)
-{
-  os << "MapEntry: ( Router: " << mpe.getRouter() << " Mapping No: ";
-  os << mpe.getMappingNumber() << " )" << std::endl;
-  return os;
-}
-
 } // namespace nlsr
 
 #endif // NLSR_MAP_ENTRY_HPP
diff --git a/src/route/map.cpp b/src/route/map.cpp
index 65d004f..a34f415 100644
--- a/src/route/map.cpp
+++ b/src/route/map.cpp
@@ -28,9 +28,11 @@
 #include "lsa.hpp"
 #include "lsdb.hpp"
 #include "map.hpp"
-
+#include "logger.hpp"
 namespace nlsr {
 
+INIT_LOGGER("Map");
+
 using namespace std;
 
 static bool
@@ -117,15 +119,14 @@
   m_mappingIndex = 0;
 }
 
-ostream&
-operator<<(ostream& os, Map& map)
+void
+Map::writeLog()
 {
-  os << "---------------Map----------------------" << endl;
-  std::list<MapEntry> ml = map.getMapList();
-  for (std::list<MapEntry>::iterator it = ml.begin(); it != ml.end() ; it++) {
-    os << (*it);
+  _LOG_DEBUG("---------------Map----------------------");
+  for (std::list<MapEntry>::iterator it = m_table.begin(); it != m_table.end() ; it++) {
+    _LOG_DEBUG("MapEntry: ( Router: " << (*it).getRouter() << " Mapping No: "
+               << (*it).getMappingNumber() << " )");
   }
-  return os;
 }
 
 } //namespace nlsr
diff --git a/src/route/map.hpp b/src/route/map.hpp
index 09cdeee..8f7d0f4 100644
--- a/src/route/map.hpp
+++ b/src/route/map.hpp
@@ -71,6 +71,8 @@
     return m_table.size();
   }
 
+  void
+  writeLog();
 
 private:
   bool
@@ -80,8 +82,5 @@
   std::list<MapEntry> m_table;
 };
 
-std::ostream&
-operator<<(std::ostream& os, Map& map);
-
 } // namespace nlsr
 #endif //NLSR_MAP_HPP
diff --git a/src/route/name-prefix-table-entry.cpp b/src/route/name-prefix-table-entry.cpp
index 80008ff..1d20319 100644
--- a/src/route/name-prefix-table-entry.cpp
+++ b/src/route/name-prefix-table-entry.cpp
@@ -103,18 +103,4 @@
   m_nexthopList.writeLog();
 }
 
-//debugging purpose
-ostream&
-operator<<(ostream& os, NamePrefixTableEntry& npte)
-{
-  os << "Name: " << npte.getNamePrefix() << endl;
-  std::list<RoutingTableEntry> rteList = npte.getRteList();
-  for (std::list<RoutingTableEntry>::iterator it = rteList.begin();
-       it != rteList.end(); ++it) {
-    cout << (*it);
-  }
-  os << npte.getNexthopList();
-  return os;
-}
-
 }//namespace nlsr
diff --git a/src/route/name-prefix-table-entry.hpp b/src/route/name-prefix-table-entry.hpp
index ee8df2b..9b25f5e 100644
--- a/src/route/name-prefix-table-entry.hpp
+++ b/src/route/name-prefix-table-entry.hpp
@@ -97,9 +97,6 @@
   NexthopList m_nexthopList;
 };
 
-std::ostream&
-operator<<(std::ostream& os, NamePrefixTableEntry& npte);
-
 }//namespace nlsr
 
 #endif //NLSR_NAME_PREFIX_TABLE_ENTRY_HPP
diff --git a/src/route/name-prefix-table.cpp b/src/route/name-prefix-table.cpp
index 582c01d..d9c63e4 100644
--- a/src/route/name-prefix-table.cpp
+++ b/src/route/name-prefix-table.cpp
@@ -164,15 +164,4 @@
   }
 }
 
-void
-NamePrefixTable::print()
-{
-  std::cout << "----------------NPT----------------------" << std::endl;
-  for (std::list<NamePrefixTableEntry>::iterator it = m_table.begin();
-       it != m_table.end();
-       ++it) {
-    cout << (*it) << endl;
-  }
-}
-
 } //namespace nlsr
diff --git a/src/route/name-prefix-table.hpp b/src/route/name-prefix-table.hpp
index 2596174..fb36ffb 100644
--- a/src/route/name-prefix-table.hpp
+++ b/src/route/name-prefix-table.hpp
@@ -52,9 +52,6 @@
   void
   writeLog();
 
-  void
-  print();
-
 private:
   void
   addEntry(const ndn::Name& name, RoutingTableEntry& rte);
diff --git a/src/route/nexthop-list.cpp b/src/route/nexthop-list.cpp
index 07b7d1f..6159563 100644
--- a/src/route/nexthop-list.cpp
+++ b/src/route/nexthop-list.cpp
@@ -105,16 +105,4 @@
   }
 }
 
-ostream&
-operator<<(ostream& os, NexthopList& nhl)
-{
-  std::list<NextHop> nexthopList = nhl.getNextHops();
-  int i = 1;
-  for (std::list<NextHop>::iterator it = nexthopList.begin();
-       it != nexthopList.end() ; it++, i++) {
-    os << "Nexthop " << i << ": " << (*it) << endl;
-  }
-  return os;
-}
-
 }//namespace nlsr
diff --git a/src/route/nexthop-list.hpp b/src/route/nexthop-list.hpp
index e358166..c34400d 100644
--- a/src/route/nexthop-list.hpp
+++ b/src/route/nexthop-list.hpp
@@ -79,9 +79,6 @@
   std::list<NextHop> m_nexthopList;
 };
 
-std::ostream&
-operator<<(std::ostream& os, NexthopList& nhl);
-
 }//namespace nlsr
 
 #endif //NLSR_NEXTHOP_LIST_HPP
diff --git a/src/route/nexthop.hpp b/src/route/nexthop.hpp
index 097230f..ecd84fa 100644
--- a/src/route/nexthop.hpp
+++ b/src/route/nexthop.hpp
@@ -71,15 +71,6 @@
   double m_routeCost;
 };
 
-
-inline std::ostream&
-operator<<(std::ostream& os, const NextHop& nh)
-{
-  os << "Face: " << nh.getConnectingFaceUri() << "  Route Cost: " <<
-     nh.getRouteCost();
-  return os;
-}
-
 }//namespace nlsr
 
 #endif //NLSR_NEXTHOP_HPP
diff --git a/src/route/routing-table-calculator.cpp b/src/route/routing-table-calculator.cpp
index 63147a5..1c39d51 100644
--- a/src/route/routing-table-calculator.cpp
+++ b/src/route/routing-table-calculator.cpp
@@ -28,9 +28,11 @@
 #include "lsa.hpp"
 #include "nexthop.hpp"
 #include "nlsr.hpp"
+#include "logger.hpp"
 
 namespace nlsr {
 
+INIT_LOGGER("RoutingTableCalculator");
 using namespace std;
 
 void
@@ -72,13 +74,15 @@
 }
 
 void
-RoutingTableCalculator::printAdjMatrix()
+RoutingTableCalculator::writeAdjMatrixLog()
 {
   for (int i = 0; i < numOfRouter; i++) {
+    string line="";
     for (int j = 0; j < numOfRouter; j++) {
-      printf("%f ", adjMatrix[i][j]);
+      line += boost::lexical_cast<std::string>(adjMatrix[i][j]);
+      line += " ";
     }
-    printf("\n");
+    _LOG_DEBUG(line);
   }
 }
 
@@ -159,22 +163,18 @@
 LinkStateRoutingTableCalculator::calculatePath(Map& pMap,
                                                RoutingTable& rt, Nlsr& pnlsr)
 {
-  std::cout << "LinkStateRoutingTableCalculator::calculatePath Called" <<
-            std::endl;
+  _LOG_DEBUG("LinkStateRoutingTableCalculator::calculatePath Called");
   allocateAdjMatrix();
   initMatrix();
   makeAdjMatrix(pnlsr, pMap);
-  std::cout << pMap;
-  printAdjMatrix();
+  //printAdjMatrix();
+  writeAdjMatrixLog();
   int sourceRouter = pMap.getMappingNoByRouterName(pnlsr.getConfParameter().getRouterPrefix());
-  //int noLink=getNumOfLinkfromAdjMatrix(sourceRouter);
   allocateParent();
   allocateDistance();
   if (pnlsr.getConfParameter().getMaxFacesPerPrefix() == 1) {
     // Single Path
     doDijkstraPathCalculation(sourceRouter);
-    // print all ls path -- debugging purpose
-    printAllLsPath(sourceRouter);
     // update routing table
     addAllLsNextHopsToRoutingTable(pnlsr, rt, pMap, sourceRouter);
   }
@@ -186,10 +186,8 @@
     getLinksFromAdjMatrix(links, linkCosts, sourceRouter);
     for (int i = 0 ; i < vNoLink; i++) {
       adjustAdMatrix(sourceRouter, links[i], linkCosts[i]);
-      printAdjMatrix();
+      writeAdjMatrixLog();
       doDijkstraPathCalculation(sourceRouter);
-      // print all ls path -- debugging purpose
-      printAllLsPath(sourceRouter);
       //update routing table
       addAllLsNextHopsToRoutingTable(pnlsr, rt, pMap, sourceRouter);
     }
@@ -243,8 +241,7 @@
 LinkStateRoutingTableCalculator::addAllLsNextHopsToRoutingTable(Nlsr& pnlsr,
                                                                 RoutingTable& rt, Map& pMap, int sourceRouter)
 {
-  std::cout <<
-            "LinkStateRoutingTableCalculator::addAllNextHopsToRoutingTable Called";
+  _LOG_DEBUG("LinkStateRoutingTableCalculator::addAllNextHopsToRoutingTable Called");
   std::cout << std::endl;
   int nextHopRouter = 0;
   for (int i = 0; i < numOfRouter ; i++) {
@@ -255,11 +252,6 @@
         ndn::Name nextHopRouterName = pMap.getRouterNameByMappingNo(nextHopRouter);
         std::string nextHopFace =
           pnlsr.getAdjacencyList().getAdjacent(nextHopRouterName).getConnectingFaceUri();
-        std::cout << "Dest Router: " << pMap.getRouterNameByMappingNo(i) << std::endl;
-        std::cout << "Next hop Router: " << nextHopRouterName << std::endl;
-        std::cout << "Next hop Face: " << nextHopFace << std::endl;
-        std::cout << "Route Cost: " << routeCost << std::endl;
-        std::cout << std::endl;
         // Add next hop to routing table
         NextHop nh(nextHopFace, routeCost);
         rt.addNextHop(pMap.getRouterNameByMappingNo(i), nh);
@@ -283,31 +275,9 @@
 }
 
 void
-LinkStateRoutingTableCalculator::printAllLsPath(int sourceRouter)
-{
-  std::cout << "LinkStateRoutingTableCalculator::printAllLsPath Called" <<
-            std::endl;
-  std::cout << "Source Router: " << sourceRouter << std::endl;
-  for (int i = 0; i < numOfRouter ; i++) {
-    if (i != sourceRouter) {
-      printLsPath(i);
-      std::cout << std::endl;
-    }
-  }
-}
-
-void
-LinkStateRoutingTableCalculator::printLsPath(int destRouter)
-{
-  if (m_parent[destRouter] != EMPTY_PARENT) {
-    printLsPath(m_parent[destRouter]);
-  }
-  std:: cout << " " << destRouter;
-}
-
-void
 LinkStateRoutingTableCalculator::sortQueueByDistance(int* Q,
-                                                     double* dist, int start, int element)
+                                                     double* dist,
+                                                     int start, int element)
 {
   for (int i = start ; i < element ; i++) {
     for (int j = i + 1; j < element; j++) {
@@ -364,6 +334,7 @@
                                          RoutingTable& rt, Nlsr& pnlsr)
 {
   makeAdjMatrix(pnlsr, pMap);
+  //std::cout << pMap;
   ndn::Name routerName = pnlsr.getConfParameter().getRouterPrefix();
   int sourceRouter = pMap.getMappingNoByRouterName(routerName);
   int noLink = getNumOfLinkfromAdjMatrix(sourceRouter);
diff --git a/src/route/routing-table-calculator.hpp b/src/route/routing-table-calculator.hpp
index e03b21e..3f1b53f 100644
--- a/src/route/routing-table-calculator.hpp
+++ b/src/route/routing-table-calculator.hpp
@@ -52,9 +52,12 @@
 
   void
   makeAdjMatrix(Nlsr& pnlsr, Map pMap);
-
+/*
   void
   printAdjMatrix();
+*/
+  void
+  writeAdjMatrixLog();
 
   int
   getNumOfLinkfromAdjMatrix(int sRouter);
@@ -123,12 +126,6 @@
   isNotExplored(int* Q, int u, int start, int element);
 
   void
-  printAllLsPath(int sourceRouter);
-
-  void
-  printLsPath(int destRouter);
-
-  void
   addAllLsNextHopsToRoutingTable(Nlsr& pnlsr, RoutingTable& rt,
                                  Map& pMap, int sourceRouter);
 
diff --git a/src/route/routing-table-entry.hpp b/src/route/routing-table-entry.hpp
index d0636e8..aa351ac 100644
--- a/src/route/routing-table-entry.hpp
+++ b/src/route/routing-table-entry.hpp
@@ -62,20 +62,6 @@
   NexthopList m_nexthopList;
 };
 
-inline std::ostream&
-operator<<(std::ostream& os, RoutingTableEntry& rte)
-{
-  os << "Destination: " << rte.getDestination() << std::endl;
-  os << "Nexthops: " << std::endl;
-  int32_t i = 1;
-  std::list<NextHop> nhl = rte.getNexthopList().getNextHops();
-  for (std::list<NextHop>::iterator it = nhl.begin();
-       it != nhl.end() ; it++, i++) {
-    os << "  Nexthop " << i << ": " << (*it) << std::endl;
-  }
-  return os;
-}
-
 } //namespace nlsr
 
 #endif //NLSR_ROUTING_TABLE_ENTRY_HPP
diff --git a/src/route/routing-table.cpp b/src/route/routing-table.cpp
index 6d632f4..613371f 100644
--- a/src/route/routing-table.cpp
+++ b/src/route/routing-table.cpp
@@ -42,11 +42,9 @@
 void
 RoutingTable::calculate(Nlsr& pnlsr)
 {
-  //debugging purpose
-  pnlsr.getNamePrefixTable().print();
-  pnlsr.getLsdb().printAdjLsdb();
-  pnlsr.getLsdb().printCorLsdb();
-  pnlsr.getLsdb().printNameLsdb();
+  pnlsr.getLsdb().writeCorLsdbLog();
+  pnlsr.getLsdb().writeNameLsdbLog();
+  pnlsr.getLsdb().writeAdjLsdbLog();
   pnlsr.getNamePrefixTable().writeLog();
   if (pnlsr.getIsRoutingTableCalculating() == false) {
     //setting routing table calculation
@@ -55,7 +53,6 @@
           pnlsr.getConfParameter().getRouterPrefix().toUri() + "/" + "adjacency",
           std::string("adjacency"))) {
       if (pnlsr.getIsBuildAdjLsaSheduled() != 1) {
-        std::cout << "CLearing old routing table ....." << std::endl;
         _LOG_DEBUG("CLearing old routing table .....");
         clearRoutingTable();
         // for dry run options
@@ -74,37 +71,25 @@
           calculateHypDryRoutingTable(pnlsr);
         }
         //need to update NPT here
+        _LOG_DEBUG("Calling Update NPT With new Route");
         pnlsr.getNamePrefixTable().updateWithNewRoute();
-        //debugging purpose
-        printRoutingTable();
-        pnlsr.getNamePrefixTable().print();
-        pnlsr.getFib().print();
         writeLog();
         pnlsr.getNamePrefixTable().writeLog();
         pnlsr.getFib().writeLog();
-        //debugging purpose end
       }
       else {
-        std::cout << "Adjacency building is scheduled, so ";
-        std::cout << "routing table can not be calculated :(" << std::endl;
         _LOG_DEBUG("Adjacency building is scheduled, so"
                    " routing table can not be calculated :(");
       }
     }
     else {
-      std::cout << "No Adj LSA of router itself,";
-      std::cout <<	" so Routing table can not be calculated :(" << std::endl;
       _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
-      std::cout << "Calling Update NPT With new Route" << std::endl;
+      _LOG_DEBUG("Calling Update NPT With new Route");
       pnlsr.getNamePrefixTable().updateWithNewRoute();
-      //debugging purpose
-      printRoutingTable();
-      pnlsr.getNamePrefixTable().print();
-      pnlsr.getFib().print();
       writeLog();
       pnlsr.getNamePrefixTable().writeLog();
       pnlsr.getFib().writeLog();
@@ -122,9 +107,10 @@
 void
 RoutingTable::calculateLsRoutingTable(Nlsr& pnlsr)
 {
-  std::cout << "RoutingTable::calculateLsRoutingTable Called" << std::endl;
+  _LOG_DEBUG("RoutingTable::calculateLsRoutingTable Called");
   Map vMap;
   vMap.createFromAdjLsdb(pnlsr);
+  vMap.writeLog();
   int numOfRouter = vMap.getMapSize();
   LinkStateRoutingTableCalculator lsrtc(numOfRouter);
   lsrtc.calculatePath(vMap, ndn::ref(*this), pnlsr);
@@ -135,6 +121,7 @@
 {
   Map vMap;
   vMap.createFromAdjLsdb(pnlsr);
+  vMap.writeLog();
   int numOfRouter = vMap.getMapSize();
   HypRoutingTableCalculator hrtc(numOfRouter, 0);
   hrtc.calculatePath(vMap, ndn::ref(*this), pnlsr);
@@ -145,6 +132,7 @@
 {
   Map vMap;
   vMap.createFromAdjLsdb(pnlsr);
+  vMap.writeLog();
   int numOfRouter = vMap.getMapSize();
   HypRoutingTableCalculator hrtc(numOfRouter, 1);
   hrtc.calculatePath(vMap, ndn::ref(*this), pnlsr);
@@ -207,17 +195,6 @@
   }
 }
 
-void
-RoutingTable::printRoutingTable()
-{
-  std::cout << "---------------Routing Table------------------" << std::endl;
-  for (std::list<RoutingTableEntry>::iterator it = m_rTable.begin() ;
-       it != m_rTable.end(); ++it) {
-    std::cout << (*it) << std::endl;
-  }
-}
-
-
 //function related to manipulation of dry routing table
 void
 RoutingTable::addNextHopToDryTable(const ndn::Name& destRouter, NextHop& nh)
@@ -237,17 +214,6 @@
 }
 
 void
-RoutingTable::printDryRoutingTable()
-{
-  std::cout << "--------Dry Run's Routing Table--------------" << std::endl;
-  for (std::list<RoutingTableEntry>::iterator it = m_dryTable.begin() ;
-       it != m_dryTable.end(); ++it) {
-    cout << (*it) << endl;
-  }
-}
-
-
-void
 RoutingTable::clearRoutingTable()
 {
   if (m_rTable.size() > 0) {
diff --git a/src/route/routing-table.hpp b/src/route/routing-table.hpp
index ecf26c9..952a07e 100644
--- a/src/route/routing-table.hpp
+++ b/src/route/routing-table.hpp
@@ -49,14 +49,8 @@
   addNextHop(const ndn::Name& destRouter, NextHop& nh);
 
   void
-  printRoutingTable();
-
-  void
   addNextHopToDryTable(const ndn::Name& destRouter, NextHop& nh);
 
-  void
-  printDryRoutingTable();
-
   RoutingTableEntry*
   findRoutingTableEntry(const ndn::Name& destRouter);
 
diff --git a/src/sequencing-manager.cpp b/src/sequencing-manager.cpp
index 72e0c47..b5bd89c 100644
--- a/src/sequencing-manager.cpp
+++ b/src/sequencing-manager.cpp
@@ -65,7 +65,7 @@
 void
 SequencingManager::initiateSeqNoFromFile()
 {
-  cout << "Seq File Name: " << m_seqFileNameWithPath << endl;
+  _LOG_DEBUG("Seq File Name: " << m_seqFileNameWithPath);
   std::ifstream inputFile(m_seqFileNameWithPath.c_str(), ios::binary);
   if (inputFile.good()) {
     inputFile >> m_combinedSeqNo;
@@ -101,15 +101,14 @@
   return homeDirPath;
 }
 
-ostream&
-operator<<(ostream& os, const SequencingManager& sm)
+void
+SequencingManager::writeLog()
 {
-  std::cout << "----SequencingManager----" << std::endl;
-  std::cout << "Adj LSA seq no: " << sm.getAdjLsaSeq() << endl;
-  std::cout << "Cor LSA Seq no: " << sm.getCorLsaSeq() << endl;
-  std::cout << "Name LSA Seq no: " << sm.getNameLsaSeq() << endl;
-  std::cout << "Combined LSDB Seq no: " << sm.getCombinedSeqNo() << endl;
-  return os;
+  _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);
+  _LOG_DEBUG("Combined LSDB Seq no: " << m_combinedSeqNo);
 }
 
 }//namespace nlsr
diff --git a/src/sequencing-manager.hpp b/src/sequencing-manager.hpp
index 48a1f96..50795b2 100644
--- a/src/sequencing-manager.hpp
+++ b/src/sequencing-manager.hpp
@@ -133,6 +133,9 @@
   std::string
   getUserHomeDirectory();
 
+  void
+  writeLog();
+
 private:
   void
   splittSequenceNo(uint64_t seqNo);
@@ -148,9 +151,5 @@
   std::string m_seqFileNameWithPath;
 };
 
-
-std::ostream&
-operator<<(std::ostream& os, const SequencingManager& sm);
-
 }//namespace nlsr
 #endif //NLSR_SEQUENCING_MANAGER_HPP
