mgmt+rib: improve logging
Change-Id: I2c8470831a9f9cbd5c06681f69783c4b442420f9
diff --git a/daemon/rib/readvertise/readvertise.cpp b/daemon/rib/readvertise/readvertise.cpp
index 164e26b..1df539d 100644
--- a/daemon/rib/readvertise/readvertise.cpp
+++ b/daemon/rib/readvertise/readvertise.cpp
@@ -68,16 +68,16 @@
{
std::optional<ReadvertiseAction> action = m_policy->handleNewRoute(ribRoute);
if (!action) {
- NFD_LOG_DEBUG("add-route " << ribRoute.entry->getName() << '(' << ribRoute.route->faceId <<
- ',' << ribRoute.route->origin << ") not-readvertising");
+ NFD_LOG_DEBUG("add-route " << ribRoute.entry->getName() << " face=" << ribRoute.route->faceId <<
+ " origin=" << ribRoute.route->origin << " -> not-readvertising");
return;
}
auto [rrIt, isNewRr] = m_rrs.emplace(action->prefix);
if (!isNewRr && rrIt->signer != action->signer) {
- NFD_LOG_WARN("add-route " << ribRoute.entry->getName() << '(' << ribRoute.route->faceId <<
- ',' << ribRoute.route->origin << ") readvertising-as " << action->prefix <<
- " old-signer " << rrIt->signer << " new-signer " << action->signer);
+ NFD_LOG_WARN("add-route " << ribRoute.entry->getName() << " face=" << ribRoute.route->faceId <<
+ " origin=" << ribRoute.route->origin << " -> readvertising-as " << action->prefix <<
+ " old-signer=" << rrIt->signer << " new-signer=" << action->signer);
}
rrIt->signer = action->signer;
@@ -85,14 +85,14 @@
BOOST_VERIFY(isNewInMap);
if (rrIt->nRibRoutes++ > 0) {
- NFD_LOG_DEBUG("add-route " << ribRoute.entry->getName() << '(' << ribRoute.route->faceId <<
- ',' << ribRoute.route->origin << ") already-readvertised-as " << action->prefix);
+ NFD_LOG_DEBUG("add-route " << ribRoute.entry->getName() << " face=" << ribRoute.route->faceId <<
+ " origin=" << ribRoute.route->origin << " -> already-readvertised-as " << action->prefix);
return;
}
- NFD_LOG_DEBUG("add-route " << ribRoute.entry->getName() << '(' << ribRoute.route->faceId <<
- ',' << ribRoute.route->origin << ") readvertising-as " << action->prefix <<
- " signer " << action->signer);
+ NFD_LOG_DEBUG("add-route " << ribRoute.entry->getName() << " face=" << ribRoute.route->faceId <<
+ " origin=" << ribRoute.route->origin << " -> readvertising-as " << action->prefix <<
+ " signer=" << action->signer);
rrIt->retryDelay = RETRY_DELAY_MIN;
this->advertise(rrIt);
}
@@ -102,8 +102,8 @@
{
auto indexIt = m_routeToRr.find(ribRoute);
if (indexIt == m_routeToRr.end()) {
- NFD_LOG_DEBUG("remove-route " << ribRoute.entry->getName() << '(' << ribRoute.route->faceId <<
- ',' << ribRoute.route->origin << ") not-readvertised");
+ NFD_LOG_DEBUG("remove-route " << ribRoute.entry->getName() << " face=" << ribRoute.route->faceId <<
+ " origin=" << ribRoute.route->origin << " -> not-readvertised");
return;
}
@@ -111,8 +111,8 @@
m_routeToRr.erase(indexIt);
if (--rrIt->nRibRoutes > 0) {
- NFD_LOG_DEBUG("remove-route " << ribRoute.entry->getName() << '(' << ribRoute.route->faceId <<
- ',' << ribRoute.route->origin << ") needed-by " << rrIt->nRibRoutes);
+ NFD_LOG_DEBUG("remove-route " << ribRoute.entry->getName() << " face=" << ribRoute.route->faceId <<
+ " origin=" << ribRoute.route->origin << " -> needed-by " << rrIt->nRibRoutes);
return;
}
@@ -149,19 +149,19 @@
BOOST_ASSERT(rrIt->nRibRoutes > 0);
if (!m_destination->isAvailable()) {
- NFD_LOG_DEBUG("advertise " << rrIt->prefix << " destination-unavailable");
+ NFD_LOG_DEBUG("advertise " << rrIt->prefix << " -> destination unavailable");
return;
}
m_destination->advertise(*rrIt,
[=] {
- NFD_LOG_DEBUG("advertise " << rrIt->prefix << " success");
+ NFD_LOG_DEBUG("advertise " << rrIt->prefix << " -> success");
rrIt->retryDelay = RETRY_DELAY_MIN;
rrIt->retryEvt = getScheduler().schedule(randomizeTimer(m_policy->getRefreshInterval()),
[=] { advertise(rrIt); });
},
[=] (const std::string& msg) {
- NFD_LOG_DEBUG("advertise " << rrIt->prefix << " failure: " << msg);
+ NFD_LOG_DEBUG("advertise " << rrIt->prefix << " -> failure: " << msg);
rrIt->retryDelay = std::min(RETRY_DELAY_MAX, rrIt->retryDelay * 2);
rrIt->retryEvt = getScheduler().schedule(randomizeTimer(rrIt->retryDelay),
[=] { advertise(rrIt); });
@@ -174,18 +174,18 @@
BOOST_ASSERT(rrIt->nRibRoutes == 0);
if (!m_destination->isAvailable()) {
- NFD_LOG_DEBUG("withdraw " << rrIt->prefix << " destination-unavailable");
+ NFD_LOG_DEBUG("withdraw " << rrIt->prefix << " -> destination unavailable");
m_rrs.erase(rrIt);
return;
}
m_destination->withdraw(*rrIt,
[=] {
- NFD_LOG_DEBUG("withdraw " << rrIt->prefix << " success");
+ NFD_LOG_DEBUG("withdraw " << rrIt->prefix << " -> success");
m_rrs.erase(rrIt);
},
[=] (const std::string& msg) {
- NFD_LOG_DEBUG("withdraw " << rrIt->prefix << " failure: " << msg);
+ NFD_LOG_DEBUG("withdraw " << rrIt->prefix << " -> failure: " << msg);
rrIt->retryDelay = std::min(RETRY_DELAY_MAX, rrIt->retryDelay * 2);
rrIt->retryEvt = getScheduler().schedule(randomizeTimer(rrIt->retryDelay),
[=] { withdraw(rrIt); });