logging: Reducing log level in several places
INFO level is suppose to be used for informational messages that are
useful for ordinary user, but in several places we used it as a DEBUG
output.
In CS the level is reduced even more, to TRACE.
Change-Id: I9058e25d95de79661099dd4624d802cc33420983
diff --git a/daemon/mgmt/face-manager.cpp b/daemon/mgmt/face-manager.cpp
index 55f4d9c..e184c00 100644
--- a/daemon/mgmt/face-manager.cpp
+++ b/daemon/mgmt/face-manager.cpp
@@ -506,19 +506,19 @@
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 @@
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 @@
{
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 @@
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 @@
if (!static_cast<bool>(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 @@
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 34554e6..75c6efb 100644
--- a/daemon/mgmt/fib-manager.cpp
+++ b/daemon/mgmt/fib-manager.cpp
@@ -89,19 +89,19 @@
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 @@
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 @@
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 @@
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 @@
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 @@
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 @@
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<Face> faceToRemove = m_getFace(parameters.getFaceId());
@@ -212,17 +211,26 @@
if (static_cast<bool>(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 @@
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 e608ffc..5296e28 100644
--- a/daemon/mgmt/manager-base.cpp
+++ b/daemon/mgmt/manager-base.cpp
@@ -100,7 +100,7 @@
ManagerBase::onCommandValidationFailed(const shared_ptr<const Interest>& 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 43824f2..c226b41 100644
--- a/daemon/mgmt/strategy-choice-manager.cpp
+++ b/daemon/mgmt/strategy-choice-manager.cpp
@@ -47,7 +47,7 @@
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 @@
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 @@
}
else
{
- NFD_LOG_INFO("command result: unsupported verb: " << verb);
+ NFD_LOG_DEBUG("command result: unsupported verb: " << verb);
setResponse(response, 501, "Unsupported command");
}
@@ -108,7 +108,7 @@
if (!validateParameters(command, parameters))
{
- NFD_LOG_INFO("strategy-choice result: FAIL reason: malformed");
+ NFD_LOG_DEBUG("strategy-choice result: FAIL reason: malformed");
setResponse(response, 400, "Malformed command");
return;
}
@@ -118,20 +118,20 @@
if (!m_strategyChoice.hasStrategy(selectedStrategy))
{
- NFD_LOG_INFO("strategy-choice result: FAIL reason: unknown-strategy: "
- << parameters.getStrategy());
+ NFD_LOG_DEBUG("strategy-choice result: FAIL reason: unknown-strategy: "
+ << parameters.getStrategy());
setResponse(response, 504, "Unsupported strategy");
return;
}
if (m_strategyChoice.insert(prefix, selectedStrategy))
{
- NFD_LOG_INFO("strategy-choice result: SUCCESS");
+ NFD_LOG_DEBUG("strategy-choice result: SUCCESS");
setResponse(response, 200, "Success", parameters.wireEncode());
}
else
{
- NFD_LOG_INFO("strategy-choice result: FAIL reason: not-installed");
+ NFD_LOG_DEBUG("strategy-choice result: FAIL reason: not-installed");
setResponse(response, 405, "Strategy not installed");
}
}
@@ -147,12 +147,12 @@
static const Name ROOT_PREFIX;
if (parameters.hasName() && parameters.getName() == ROOT_PREFIX)
{
- NFD_LOG_INFO("strategy-choice result: FAIL reason: unset-root");
+ NFD_LOG_DEBUG("strategy-choice result: FAIL reason: unset-root");
setResponse(response, 403, "Cannot unset root prefix strategy");
}
else
{
- NFD_LOG_INFO("strategy-choice result: FAIL reason: malformed");
+ NFD_LOG_DEBUG("strategy-choice result: FAIL reason: malformed");
setResponse(response, 400, "Malformed command");
}
return;
@@ -160,7 +160,7 @@
m_strategyChoice.erase(parameters.getName());
- NFD_LOG_INFO("strategy-choice result: SUCCESS");
+ NFD_LOG_DEBUG("strategy-choice result: SUCCESS");
setResponse(response, 200, "Success", parameters.wireEncode());
}