face: cleanup log messages in all faces and print fail reason
Change-Id: I405198b375a0317663d29810ee87922a19edccaa
Refs: #2450
diff --git a/daemon/fw/face-table.cpp b/daemon/fw/face-table.cpp
index 1848380..0f78f74 100644
--- a/daemon/fw/face-table.cpp
+++ b/daemon/fw/face-table.cpp
@@ -87,21 +87,24 @@
face->onReceiveInterest.connect(bind(&Forwarder::onInterest, &m_forwarder, ref(*face), _1));
face->onReceiveData.connect(bind(&Forwarder::onData, &m_forwarder, ref(*face), _1));
- face->onFail.connectSingleShot(bind(&FaceTable::remove, this, face));
+ face->onFail.connectSingleShot(bind(&FaceTable::remove, this, face, _1));
this->onAdd(face);
}
void
-FaceTable::remove(shared_ptr<Face> face)
+FaceTable::remove(shared_ptr<Face> face, const std::string& reason)
{
this->onRemove(face);
FaceId faceId = face->getId();
m_faces.erase(faceId);
face->setId(INVALID_FACEID);
- NFD_LOG_INFO("Removed face id=" << faceId << " remote=" << face->getRemoteUri() <<
- " local=" << face->getLocalUri());
+
+ NFD_LOG_INFO("Removed face id=" << faceId <<
+ " remote=" << face->getRemoteUri() <<
+ " local=" << face->getLocalUri() <<
+ " (" << reason << ")");
m_forwarder.getFib().removeNextHopFromAllEntries(face);
}