diff --git a/daemon/fw/face-table.cpp b/daemon/fw/face-table.cpp index 86015989..f59ff14b 100644 --- a/daemon/fw/face-table.cpp +++ b/daemon/fw/face-table.cpp @@ -36,7 +36,7 @@ FaceTable::add(shared_ptr face) FaceId faceId = ++m_lastFaceId; face->setId(faceId); m_faces[faceId] = face; - NFD_LOG_INFO("addFace id=" << faceId); + NFD_LOG_INFO("Added face id=" << faceId << " uri=" << face->getUri()); face->onReceiveInterest += bind(&Forwarder::onInterest, &m_forwarder, boost::ref(*face), _1); @@ -56,7 +56,7 @@ FaceTable::remove(shared_ptr face) FaceId faceId = face->getId(); m_faces.erase(faceId); face->setId(INVALID_FACEID); - NFD_LOG_INFO("removeFace id=" << faceId); + NFD_LOG_INFO("Removed face id=" << faceId << " uri=" << face->getUri()); // XXX This clears all subscriptions, because EventEmitter // does not support only removing Forwarder's subscription diff --git a/daemon/mgmt/face-manager.cpp b/daemon/mgmt/face-manager.cpp index 55f4d9cd..e184c003 100644 --- a/daemon/mgmt/face-manager.cpp +++ b/daemon/mgmt/face-manager.cpp @@ -506,19 +506,19 @@ FaceManager::onFaceRequest(const Interest& request) UnsignedVerbDispatchTable::const_iterator unsignedVerbProcessor = m_unsignedVerbDispatch.find(verb); if (unsignedVerbProcessor != m_unsignedVerbDispatch.end()) { - NFD_LOG_INFO("command result: processing verb: " << verb); + NFD_LOG_DEBUG("command result: processing verb: " << verb); (unsignedVerbProcessor->second)(this, boost::cref(request)); } else if (COMMAND_UNSIGNED_NCOMPS <= commandNComps && commandNComps < COMMAND_SIGNED_NCOMPS) { - NFD_LOG_INFO("command result: unsigned verb: " << command); + NFD_LOG_DEBUG("command result: unsigned verb: " << command); sendResponse(command, 401, "Signature required"); } else if (commandNComps < COMMAND_SIGNED_NCOMPS || !COMMAND_PREFIX.isPrefixOf(command)) { - NFD_LOG_INFO("command result: malformed"); + NFD_LOG_DEBUG("command result: malformed"); sendResponse(command, 400, "Malformed command"); } else @@ -546,12 +546,12 @@ FaceManager::onValidatedFaceRequest(const shared_ptr& request) return; } - NFD_LOG_INFO("command result: processing verb: " << verb); + NFD_LOG_DEBUG("command result: processing verb: " << verb); (signedVerbProcessor->second)(this, *request, parameters); } else { - NFD_LOG_INFO("command result: unsupported verb: " << verb); + NFD_LOG_DEBUG("command result: unsupported verb: " << verb); sendResponse(command, 501, "Unsupported command"); } @@ -562,7 +562,7 @@ FaceManager::addCreatedFaceToForwarder(const shared_ptr& newFace) { m_faceTable.add(newFace); - NFD_LOG_INFO("Created face " << newFace->getUri() << " ID " << newFace->getId()); + NFD_LOG_DEBUG("Created face " << newFace->getUri() << " ID " << newFace->getId()); } void @@ -579,7 +579,7 @@ FaceManager::onCreated(const Name& requestName, void FaceManager::onConnectFailed(const Name& requestName, const std::string& reason) { - NFD_LOG_INFO("Failed to create face: " << reason); + NFD_LOG_DEBUG("Failed to create face: " << reason); sendResponse(requestName, 400, "Failed to create face"); } @@ -681,14 +681,14 @@ FaceManager::extractLocalControlParameters(const Interest& request, if (!static_cast(face)) { - NFD_LOG_INFO("command result: faceid " << request.getIncomingFaceId() << " not found"); + NFD_LOG_DEBUG("command result: faceid " << request.getIncomingFaceId() << " not found"); sendResponse(request.getName(), 410, "Face not found"); return false; } else if (!face->isLocal()) { - NFD_LOG_INFO("command result: cannot enable local control on non-local faceid " << - face->getId()); + NFD_LOG_DEBUG("command result: cannot enable local control on non-local faceid " << + face->getId()); sendResponse(request.getName(), 412, "Face is non-local"); return false; } @@ -740,7 +740,7 @@ FaceManager::listFaces(const Interest& request) if (commandNComps < LIST_COMMAND_NCOMPS || !LIST_COMMAND_PREFIX.isPrefixOf(command)) { - NFD_LOG_INFO("command result: malformed"); + NFD_LOG_DEBUG("command result: malformed"); sendResponse(command, 400, "Malformed command"); return; } diff --git a/daemon/mgmt/fib-manager.cpp b/daemon/mgmt/fib-manager.cpp index 34554e6b..75c6efb8 100644 --- a/daemon/mgmt/fib-manager.cpp +++ b/daemon/mgmt/fib-manager.cpp @@ -89,19 +89,19 @@ FibManager::onFibRequest(const Interest& request) UnsignedVerbDispatchTable::const_iterator unsignedVerbProcessor = m_unsignedVerbDispatch.find(verb); if (unsignedVerbProcessor != m_unsignedVerbDispatch.end()) { - NFD_LOG_INFO("command result: processing verb: " << verb); + NFD_LOG_DEBUG("command result: processing verb: " << verb); (unsignedVerbProcessor->second)(this, boost::cref(request)); } else if (COMMAND_UNSIGNED_NCOMPS <= commandNComps && commandNComps < COMMAND_SIGNED_NCOMPS) { - NFD_LOG_INFO("command result: unsigned verb: " << command); + NFD_LOG_DEBUG("command result: unsigned verb: " << command); sendResponse(command, 401, "Signature required"); } else if (commandNComps < COMMAND_SIGNED_NCOMPS || !COMMAND_PREFIX.isPrefixOf(command)) { - NFD_LOG_INFO("command result: malformed"); + NFD_LOG_DEBUG("command result: malformed"); sendResponse(command, 400, "Malformed command"); } else @@ -125,7 +125,7 @@ FibManager::onValidatedFibRequest(const shared_ptr& request) ControlParameters parameters; if (!extractParameters(parameterComponent, parameters) || !parameters.hasFaceId()) { - NFD_LOG_INFO("command result: malformed verb: " << verb); + NFD_LOG_DEBUG("command result: malformed verb: " << verb); sendResponse(command, 400, "Malformed command"); return; } @@ -135,14 +135,14 @@ FibManager::onValidatedFibRequest(const shared_ptr& request) parameters.setFaceId(request->getIncomingFaceId()); } - NFD_LOG_INFO("command result: processing verb: " << verb); + NFD_LOG_DEBUG("command result: processing verb: " << verb); ControlResponse response; (signedVerbProcessor->second)(this, parameters, response); sendResponse(command, response); } else { - NFD_LOG_INFO("command result: unsupported verb: " << verb); + NFD_LOG_DEBUG("command result: unsupported verb: " << verb); sendResponse(command, 501, "Unsupported command"); } } @@ -155,7 +155,7 @@ FibManager::addNextHop(ControlParameters& parameters, if (!validateParameters(command, parameters)) { - NFD_LOG_INFO("add-nexthop result: FAIL reason: malformed"); + NFD_LOG_DEBUG("add-nexthop result: FAIL reason: malformed"); setResponse(response, 400, "Malformed command"); return; } @@ -164,7 +164,7 @@ FibManager::addNextHop(ControlParameters& parameters, FaceId faceId = parameters.getFaceId(); uint64_t cost = parameters.getCost(); - NFD_LOG_DEBUG("add-nexthop prefix: " << prefix + NFD_LOG_TRACE("add-nexthop prefix: " << prefix << " faceid: " << faceId << " cost: " << cost); @@ -175,17 +175,16 @@ FibManager::addNextHop(ControlParameters& parameters, entry->addNextHop(nextHopFace, cost); - NFD_LOG_INFO("add-nexthop result: OK" - << " prefix:" << prefix - << " faceid: " << faceId - << " cost: " << cost); + NFD_LOG_DEBUG("add-nexthop result: OK" + << " prefix:" << prefix + << " faceid: " << faceId + << " cost: " << cost); - NFD_LOG_INFO("add-nexthop result: SUCCESS"); setResponse(response, 200, "Success", parameters.wireEncode()); } else { - NFD_LOG_INFO("add-nexthop result: FAIL reason: unknown-faceid: " << faceId); + NFD_LOG_DEBUG("add-nexthop result: FAIL reason: unknown-faceid: " << faceId); setResponse(response, 410, "Face not found"); } } @@ -197,12 +196,12 @@ FibManager::removeNextHop(ControlParameters& parameters, ndn::nfd::FibRemoveNextHopCommand command; if (!validateParameters(command, parameters)) { - NFD_LOG_INFO("remove-nexthop result: FAIL reason: malformed"); + NFD_LOG_DEBUG("remove-nexthop result: FAIL reason: malformed"); setResponse(response, 400, "Malformed command"); return; } - NFD_LOG_DEBUG("remove-nexthop prefix: " << parameters.getName() + NFD_LOG_TRACE("remove-nexthop prefix: " << parameters.getName() << " faceid: " << parameters.getFaceId()); shared_ptr faceToRemove = m_getFace(parameters.getFaceId()); @@ -212,17 +211,26 @@ FibManager::removeNextHop(ControlParameters& parameters, if (static_cast(entry)) { entry->removeNextHop(faceToRemove); - NFD_LOG_INFO("remove-nexthop result: OK prefix: " << parameters.getName() - << " faceid: " << parameters.getFaceId()); + NFD_LOG_DEBUG("remove-nexthop result: OK prefix: " << parameters.getName() + << " faceid: " << parameters.getFaceId()); if (!entry->hasNextHops()) { m_managedFib.erase(*entry); } } + else + { + NFD_LOG_DEBUG("remove-nexthop result: OK, but entry for face id " + << parameters.getFaceId() << " not found"); + } + } + else + { + NFD_LOG_DEBUG("remove-nexthop result: OK, but face id " + << parameters.getFaceId() << " not found"); } - NFD_LOG_INFO("remove-nexthop result: SUCCESS"); setResponse(response, 200, "Success", parameters.wireEncode()); } @@ -235,7 +243,7 @@ FibManager::listEntries(const Interest& request) if (commandNComps < LIST_COMMAND_NCOMPS || !LIST_COMMAND_PREFIX.isPrefixOf(command)) { - NFD_LOG_INFO("command result: malformed"); + NFD_LOG_DEBUG("command result: malformed"); sendResponse(command, 400, "Malformed command"); return; } diff --git a/daemon/mgmt/manager-base.cpp b/daemon/mgmt/manager-base.cpp index e608ffc5..5296e28f 100644 --- a/daemon/mgmt/manager-base.cpp +++ b/daemon/mgmt/manager-base.cpp @@ -100,7 +100,7 @@ void ManagerBase::onCommandValidationFailed(const shared_ptr& command, const std::string& error) { - NFD_LOG_INFO("command result: unauthorized command: " << *command); + NFD_LOG_DEBUG("command result: unauthorized command: " << *command); sendResponse(command->getName(), 403, "Unauthorized command"); } diff --git a/daemon/mgmt/strategy-choice-manager.cpp b/daemon/mgmt/strategy-choice-manager.cpp index 43824f28..c226b419 100644 --- a/daemon/mgmt/strategy-choice-manager.cpp +++ b/daemon/mgmt/strategy-choice-manager.cpp @@ -47,7 +47,7 @@ StrategyChoiceManager::onStrategyChoiceRequest(const Interest& request) if (COMMAND_UNSIGNED_NCOMPS <= commandNComps && commandNComps < COMMAND_SIGNED_NCOMPS) { - NFD_LOG_INFO("command result: unsigned verb: " << command); + NFD_LOG_DEBUG("command result: unsigned verb: " << command); sendResponse(command, 401, "Signature required"); return; @@ -55,7 +55,7 @@ StrategyChoiceManager::onStrategyChoiceRequest(const Interest& request) else if (commandNComps < COMMAND_SIGNED_NCOMPS || !COMMAND_PREFIX.isPrefixOf(command)) { - NFD_LOG_INFO("command result: malformed"); + NFD_LOG_DEBUG("command result: malformed"); sendResponse(command, 400, "Malformed command"); return; } @@ -93,7 +93,7 @@ StrategyChoiceManager::onValidatedStrategyChoiceRequest(const shared_ptrfirst << "]" << " " << &(*it->second)); + NFD_LOG_TRACE("[" << it->first << "]" << " " << &(*it->second)); } } diff --git a/daemon/table/cs.cpp b/daemon/table/cs.cpp index a4c05256..3dc788a9 100644 --- a/daemon/table/cs.cpp +++ b/daemon/table/cs.cpp @@ -58,8 +58,8 @@ Cs::getLimit() const std::pair< shared_ptr, bool> Cs::insertToSkipList(const Data& data, bool isUnsolicited) { - NFD_LOG_INFO("insertToSkipList() " << data.getName()); - NFD_LOG_DEBUG("SkipList size " << size()); + NFD_LOG_TRACE("insertToSkipList() " << data.getName() << ", " + << "skipList size " << size()); shared_ptr entry = make_shared(data, isUnsolicited); @@ -131,14 +131,14 @@ Cs::insertToSkipList(const Data& data, bool isUnsolicited) //check if this is a duplicate packet if (isNameIdentical) { - NFD_LOG_DEBUG("Duplicate name (with digest)"); + NFD_LOG_TRACE("Duplicate name (with digest)"); (*head)->setData(data, entry->getDigest()); //updates stale time return std::make_pair(*head, false); } - NFD_LOG_DEBUG("Not a duplicate"); + NFD_LOG_TRACE("Not a duplicate"); size_t randomLayer = pickRandomLayer(); @@ -161,18 +161,18 @@ Cs::insertToSkipList(const Data& data, bool isUnsolicited) --last; entry->setIterator(layer, last); - NFD_LOG_DEBUG("pushback " << &(*last)); + NFD_LOG_TRACE("pushback " << &(*last)); } else if (updateTable[layer] == (*i)->end() && insertInFront) { (*i)->push_front(entry); entry->setIterator(layer, (*i)->begin()); - NFD_LOG_DEBUG("pushfront "); + NFD_LOG_TRACE("pushfront "); } else { - NFD_LOG_DEBUG("insertafter"); + NFD_LOG_TRACE("insertafter"); ++updateTable[layer]; // insert after SkipListLayer::iterator position = (*i)->insert(updateTable[layer], entry); entry->setIterator(layer, position); // save iterator where item was inserted @@ -188,7 +188,7 @@ Cs::insertToSkipList(const Data& data, bool isUnsolicited) bool Cs::insert(const Data& data, bool isUnsolicited) { - NFD_LOG_INFO("insert() " << data.getName()); + NFD_LOG_TRACE("insert() " << data.getName()); if (isFull()) { @@ -241,8 +241,8 @@ Cs::isFull() const bool Cs::eraseFromSkipList(shared_ptr entry) { - NFD_LOG_INFO("eraseFromSkipList() " << entry->getName()); - NFD_LOG_DEBUG("SkipList size " << size()); + NFD_LOG_TRACE("eraseFromSkipList() " << entry->getName()); + NFD_LOG_TRACE("SkipList size " << size()); bool isErased = false; @@ -280,12 +280,12 @@ Cs::eraseFromSkipList(shared_ptr entry) bool Cs::evictItem() { - NFD_LOG_INFO("evictItem()"); + NFD_LOG_TRACE("evictItem()"); //because there is a possibility that this item is in a queue, but no longer in skiplist while ( !m_unsolicitedContent.empty() ) { - NFD_LOG_DEBUG("Evict from unsolicited queue"); + NFD_LOG_TRACE("Evict from unsolicited queue"); shared_ptr entry = m_unsolicitedContent.front(); m_unsolicitedContent.pop(); @@ -299,7 +299,7 @@ Cs::evictItem() int nIterations = size() * 0.01; // 1% of the Content Store while ( !m_contentByStaleness.empty() ) { - NFD_LOG_DEBUG("Evict from staleness queue"); + NFD_LOG_TRACE("Evict from staleness queue"); shared_ptr entry = m_contentByStaleness.top(); @@ -332,7 +332,7 @@ Cs::evictItem() //because there is a possibility that this item is in a queue, but no longer in skiplist while ( !m_contentByArrival.empty() ) { - NFD_LOG_DEBUG("Evict from arrival queue"); + NFD_LOG_TRACE("Evict from arrival queue"); shared_ptr entry = m_contentByArrival.front(); m_contentByArrival.pop(); @@ -348,7 +348,7 @@ Cs::evictItem() const Data* Cs::find(const Interest& interest) const { - NFD_LOG_INFO("find() " << interest.getName()); + NFD_LOG_TRACE("find() " << interest.getName()); bool isIterated = false; SkipList::const_reverse_iterator topLayer = m_skipList.rbegin(); @@ -385,7 +385,7 @@ Cs::find(const Interest& interest) const while ( (*it)->getName() < interest.getName() ) { - NFD_LOG_DEBUG((*it)->getName() << " < " << interest.getName()); + NFD_LOG_TRACE((*it)->getName() << " < " << interest.getName()); head = it; isIterated = true; @@ -425,7 +425,7 @@ Cs::selectChild(const Interest& interest, SkipListLayer::iterator startingPoint) BOOST_ASSERT( (*startingPoint)->getName() < interest.getName() ); } - NFD_LOG_INFO("selectChild() " << interest.getChildSelector() << " " << (*startingPoint)->getName()); + NFD_LOG_TRACE("selectChild() " << interest.getChildSelector() << " " << (*startingPoint)->getName()); bool hasLeftmostSelector = (interest.getChildSelector() <= 0); bool hasRightmostSelector = !hasLeftmostSelector; @@ -496,7 +496,7 @@ Cs::selectChild(const Interest& interest, SkipListLayer::iterator startingPoint) { // get prefix which is one component longer than Interest name (without digest) const Name& childPrefix = (*rightmostCandidate)->getName().getPrefix(interest.getName().size()); - NFD_LOG_DEBUG("Child prefix" << childPrefix); + NFD_LOG_TRACE("Child prefix" << childPrefix); if ( currentChildPrefix.empty() || (childPrefix != currentChildPrefix) ) { @@ -508,7 +508,7 @@ Cs::selectChild(const Interest& interest, SkipListLayer::iterator startingPoint) { // get prefix which is one component longer than Interest name const Name& childPrefix = (*rightmostCandidate)->getName().getPrefix(interest.getName().size() + 1); - NFD_LOG_DEBUG("Child prefix" << childPrefix); + NFD_LOG_TRACE("Child prefix" << childPrefix); if ( currentChildPrefix.empty() || (childPrefix != currentChildPrefix) ) { @@ -558,7 +558,7 @@ Cs::selectChild(const Interest& interest, SkipListLayer::iterator startingPoint) bool Cs::doesComplyWithSelectors(const Interest& interest, shared_ptr entry) const { - NFD_LOG_INFO("doesComplyWithSelectors()"); + NFD_LOG_TRACE("doesComplyWithSelectors()"); /// \todo The following detection is not correct /// 1. If data name ends with 32-octet component doesn't mean that this component is digest @@ -575,7 +575,7 @@ Cs::doesComplyWithSelectors(const Interest& interest, shared_ptr entr if (std::memcmp(digest->buf(), last.value(), ndn::crypto::SHA256_DIGEST_SIZE) != 0) { - NFD_LOG_DEBUG("violates implicit digest"); + NFD_LOG_TRACE("violates implicit digest"); return false; } } @@ -589,7 +589,7 @@ Cs::doesComplyWithSelectors(const Interest& interest, shared_ptr entr bool isSatisfied = (minDataNameLength <= entry->getName().size()); if ( !isSatisfied ) { - NFD_LOG_DEBUG("violates minComponents"); + NFD_LOG_TRACE("violates minComponents"); return false; } } @@ -601,7 +601,7 @@ Cs::doesComplyWithSelectors(const Interest& interest, shared_ptr entr bool isSatisfied = (maxDataNameLength >= entry->getName().size()); if ( !isSatisfied ) { - NFD_LOG_DEBUG("violates maxComponents"); + NFD_LOG_TRACE("violates maxComponents"); return false; } } @@ -609,7 +609,7 @@ Cs::doesComplyWithSelectors(const Interest& interest, shared_ptr entr if (interest.getMustBeFresh() && entry->getStaleTime() < time::steady_clock::now()) { - NFD_LOG_DEBUG("violates mustBeFresh"); + NFD_LOG_TRACE("violates mustBeFresh"); return false; } @@ -621,7 +621,7 @@ Cs::doesComplyWithSelectors(const Interest& interest, shared_ptr entr { if (interest.getExclude().isExcluded(lastComponent)) { - NFD_LOG_DEBUG("violates exclusion"); + NFD_LOG_TRACE("violates exclusion"); return false; } } @@ -636,15 +636,14 @@ Cs::doesComplyWithSelectors(const Interest& interest, shared_ptr entr { if (interest.getExclude().isExcluded(nextComponent)) { - NFD_LOG_DEBUG("violates exclusion"); + NFD_LOG_TRACE("violates exclusion"); return false; } } } } - - NFD_LOG_DEBUG("complies!"); + NFD_LOG_TRACE("complies"); return true; } @@ -659,7 +658,7 @@ Cs::recognizeInterestWithDigest(const Interest& interest, shared_ptr const ndn::name::Component& last = interest.getName().get(-1); if (last.value_size() == ndn::crypto::SHA256_DIGEST_SIZE) { - NFD_LOG_DEBUG("digest recognized"); + NFD_LOG_TRACE("digest recognized"); return true; } } @@ -670,8 +669,8 @@ Cs::recognizeInterestWithDigest(const Interest& interest, shared_ptr void Cs::erase(const Name& exactName) { - NFD_LOG_INFO("insert() " << exactName); - NFD_LOG_DEBUG("SkipList size " << size()); + NFD_LOG_TRACE("insert() " << exactName << ", " + << "skipList size " << size()); bool isIterated = false; SkipListLayer::iterator updateTable[SKIPLIST_MAX_LAYERS]; @@ -734,13 +733,13 @@ Cs::erase(const Name& exactName) bool isNameIdentical = false; if (!isCsEmpty && isInBoundaries) { - NFD_LOG_DEBUG("Identical? " << (*head)->getName()); + NFD_LOG_TRACE("Identical? " << (*head)->getName()); isNameIdentical = (*head)->getName() == exactName; } if (isNameIdentical) { - NFD_LOG_DEBUG("Found target " << (*head)->getName()); + NFD_LOG_TRACE("Found target " << (*head)->getName()); eraseFromSkipList(*head); } @@ -750,14 +749,14 @@ Cs::erase(const Name& exactName) void Cs::printSkipList() const { - NFD_LOG_INFO("print()"); + NFD_LOG_TRACE("print()"); //start from the upper layer towards bottom int layer = m_skipList.size() - 1; for (SkipList::const_reverse_iterator rit = m_skipList.rbegin(); rit != m_skipList.rend(); ++rit) { for (SkipListLayer::iterator it = (*rit)->begin(); it != (*rit)->end(); ++it) { - NFD_LOG_DEBUG("Layer " << layer << " " << (*it)->getName()); + NFD_LOG_TRACE("Layer " << layer << " " << (*it)->getName()); } layer--; } diff --git a/daemon/table/name-tree.cpp b/daemon/table/name-tree.cpp index 1d2e2117..b71c9708 100644 --- a/daemon/table/name-tree.cpp +++ b/daemon/table/name-tree.cpp @@ -65,12 +65,12 @@ NameTree::~NameTree() std::pair, bool> NameTree::insert(const Name& prefix) { - NFD_LOG_DEBUG("insert " << prefix); + NFD_LOG_TRACE("insert " << prefix); uint32_t hashValue = name_tree::hashName(prefix); uint32_t loc = hashValue % m_nBuckets; - NFD_LOG_DEBUG("Name " << prefix << " hash value = " << hashValue << " location = " << loc); + NFD_LOG_TRACE("Name " << prefix << " hash value = " << hashValue << " location = " << loc); // Check if this Name has been stored name_tree::Node* node = m_buckets[loc]; @@ -88,7 +88,7 @@ NameTree::insert(const Name& prefix) nodePrev = node; } - NFD_LOG_DEBUG("Did not find " << prefix << ", need to insert it to the table"); + NFD_LOG_TRACE("Did not find " << prefix << ", need to insert it to the table"); // If no bucket is empty occupied, we need to create a new node, and it is // linked from nodePrev @@ -117,7 +117,7 @@ NameTree::insert(const Name& prefix) shared_ptr NameTree::lookup(const Name& prefix) { - NFD_LOG_DEBUG("lookup " << prefix); + NFD_LOG_TRACE("lookup " << prefix); shared_ptr entry; shared_ptr parent; @@ -155,12 +155,12 @@ NameTree::lookup(const Name& prefix) shared_ptr NameTree::findExactMatch(const Name& prefix) const { - NFD_LOG_DEBUG("findExactMatch " << prefix); + NFD_LOG_TRACE("findExactMatch " << prefix); uint32_t hashValue = name_tree::hashName(prefix); uint32_t loc = hashValue % m_nBuckets; - NFD_LOG_DEBUG("Name " << prefix << " hash value = " << hashValue << + NFD_LOG_TRACE("Name " << prefix << " hash value = " << hashValue << " location = " << loc); shared_ptr entry; @@ -189,7 +189,7 @@ NameTree::findExactMatch(const Name& prefix) const shared_ptr NameTree::findLongestPrefixMatch(const Name& prefix, const name_tree::EntrySelector& entrySelector) const { - NFD_LOG_DEBUG("findLongestPrefixMatch " << prefix); + NFD_LOG_TRACE("findLongestPrefixMatch " << prefix); shared_ptr entry; @@ -222,7 +222,7 @@ NameTree::eraseEntryIfEmpty(shared_ptr entry) { BOOST_ASSERT(static_cast(entry)); - NFD_LOG_DEBUG("eraseEntryIfEmpty " << entry->getPrefix()); + NFD_LOG_TRACE("eraseEntryIfEmpty " << entry->getPrefix()); // first check if this Entry can be erased if (entry->isEmpty()) @@ -291,7 +291,7 @@ NameTree::eraseEntryIfEmpty(shared_ptr entry) NameTree::const_iterator NameTree::fullEnumerate(const name_tree::EntrySelector& entrySelector) const { - NFD_LOG_DEBUG("fullEnumerate"); + NFD_LOG_TRACE("fullEnumerate"); // find the first eligible entry for (size_t i = 0; i < m_nBuckets; i++) @@ -347,7 +347,7 @@ NameTree::const_iterator NameTree::findAllMatches(const Name& prefix, const name_tree::EntrySelector& entrySelector) const { - NFD_LOG_DEBUG("NameTree::findAllMatches" << prefix); + NFD_LOG_TRACE("NameTree::findAllMatches" << prefix); // As we are using Name Prefix Hash Table, and the current LPM() is // implemented as starting from full name, and reduce the number of @@ -370,7 +370,7 @@ NameTree::findAllMatches(const Name& prefix, void NameTree::resize(size_t newNBuckets) { - NFD_LOG_DEBUG("resize"); + NFD_LOG_TRACE("resize"); name_tree::Node** newBuckets = new name_tree::Node*[newNBuckets]; size_t count = 0; @@ -424,7 +424,7 @@ NameTree::resize(size_t newNBuckets) void NameTree::dump(std::ostream& output) const { - NFD_LOG_DEBUG("dump()"); + NFD_LOG_TRACE("dump()"); name_tree::Node* node = 0; shared_ptr entry; @@ -493,7 +493,7 @@ NameTree::const_iterator::const_iterator(NameTree::IteratorType type, NameTree::const_iterator NameTree::const_iterator::operator++() { - NFD_LOG_DEBUG("const_iterator::operator++()"); + NFD_LOG_TRACE("const_iterator::operator++()"); BOOST_ASSERT(m_entry != m_nameTree.m_end); diff --git a/daemon/table/strategy-choice-entry.cpp b/daemon/table/strategy-choice-entry.cpp index 9d3f218e..7933f33c 100644 --- a/daemon/table/strategy-choice-entry.cpp +++ b/daemon/table/strategy-choice-entry.cpp @@ -5,6 +5,10 @@ */ #include "strategy-choice-entry.hpp" +#include "core/logger.hpp" +#include "fw/strategy.hpp" + +NFD_LOG_INIT("StrategyChoiceEntry"); namespace nfd { namespace strategy_choice { @@ -19,6 +23,8 @@ Entry::setStrategy(shared_ptr strategy) { BOOST_ASSERT(static_cast(strategy)); m_strategy = strategy; + + NFD_LOG_INFO("Set strategy " << strategy->getName() << " for " << m_prefix << " prefix"); } } // namespace strategy_choice diff --git a/daemon/table/strategy-choice.cpp b/daemon/table/strategy-choice.cpp index ee63d045..11bf120c 100644 --- a/daemon/table/strategy-choice.cpp +++ b/daemon/table/strategy-choice.cpp @@ -53,12 +53,12 @@ StrategyChoice::insert(const Name& prefix, const Name& strategyName) if (static_cast(entry)) { if (entry->getStrategy().getName() == strategyName) { - NFD_LOG_INFO("insert(" << prefix << "," << strategyName << ") not changing"); + NFD_LOG_TRACE("insert(" << prefix << "," << strategyName << ") not changing"); return true; } oldStrategy = entry->getStrategy().shared_from_this(); - NFD_LOG_INFO("insert(" << prefix << "," << strategyName << ") " - "changing from " << oldStrategy->getName()); + NFD_LOG_TRACE("insert(" << prefix << "," << strategyName << ") " + "changing from " << oldStrategy->getName()); } shared_ptr strategy = this->getStrategy(strategyName); @@ -72,7 +72,7 @@ StrategyChoice::insert(const Name& prefix, const Name& strategyName) entry = make_shared(prefix); nameTreeEntry->setStrategyChoiceEntry(entry); ++m_nItems; - NFD_LOG_INFO("insert(" << prefix << "," << strategyName << ") new entry"); + NFD_LOG_TRACE("insert(" << prefix << "," << strategyName << ") new entry"); } this->changeStrategy(entry, oldStrategy, strategy); @@ -184,7 +184,7 @@ StrategyChoice::setDefaultStrategy(shared_ptr strategy) shared_ptr entry = make_shared(Name()); nameTreeEntry->setStrategyChoiceEntry(entry); ++m_nItems; - NFD_LOG_INFO("setDefaultStrategy(" << strategy->getName() << ") new entry"); + NFD_LOG_INFO("Set default strategy " << strategy->getName()); entry->setStrategy(strategy); }