diff --git a/daemon/rib/fib-updater.cpp b/daemon/rib/fib-updater.cpp
index 897b6fb..0b8fc0e 100644
--- a/daemon/rib/fib-updater.cpp
+++ b/daemon/rib/fib-updater.cpp
@@ -64,24 +64,23 @@
 void
 FibUpdater::computeUpdates(const RibUpdateBatch& batch)
 {
-  NFD_LOG_DEBUG("Computing updates for batch with faceID: " << batch.getFaceId());
+  NFD_LOG_TRACE("Computing updates for batch with faceid=" << batch.getFaceId());
 
   // Compute updates and add to m_fibUpdates
   for (const RibUpdate& update : batch) {
     switch (update.getAction()) {
-      case RibUpdate::REGISTER:
-        computeUpdatesForRegistration(update);
-        break;
-      case RibUpdate::UNREGISTER:
-        computeUpdatesForUnregistration(update);
-        break;
-      case RibUpdate::REMOVE_FACE:
-        computeUpdatesForUnregistration(update);
-
-        // Do not apply updates with the same face ID as the destroyed face
-        // since they will be rejected by the FIB
-        m_updatesForBatchFaceId.clear();
-        break;
+    case RibUpdate::REGISTER:
+      computeUpdatesForRegistration(update);
+      break;
+    case RibUpdate::UNREGISTER:
+      computeUpdatesForUnregistration(update);
+      break;
+    case RibUpdate::REMOVE_FACE:
+      computeUpdatesForUnregistration(update);
+      // Do not apply updates with the same face ID as the destroyed face
+      // since they will be rejected by the FIB
+      m_updatesForBatchFaceId.clear();
+      break;
     }
   }
 }
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); });
diff --git a/daemon/rib/rib-update.cpp b/daemon/rib/rib-update.cpp
index 935ccce..8fc5000 100644
--- a/daemon/rib/rib-update.cpp
+++ b/daemon/rib/rib-update.cpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /*
- * Copyright (c) 2014-2023,  Regents of the University of California,
+ * Copyright (c) 2014-2025,  Regents of the University of California,
  *                           Arizona Board of Regents,
  *                           Colorado State University,
  *                           University Pierre & Marie Curie, Sorbonne University,
@@ -44,10 +44,9 @@
 std::ostream&
 operator<<(std::ostream& os, const RibUpdate& update)
 {
-  return os << "RibUpdate {\n"
-            << "  Name: " << update.getName() << "\n"
-            << "  Action: " << update.getAction() << "\n"
-            << "  " << update.getRoute() << "\n"
+  return os << "RibUpdate{" << update.getAction()
+            << ", " << update.getName()
+            << ", " << update.getRoute()
             << "}";
 }
 
diff --git a/daemon/rib/route.cpp b/daemon/rib/route.cpp
index 5011290..642aa1e 100644
--- a/daemon/rib/route.cpp
+++ b/daemon/rib/route.cpp
@@ -35,13 +35,14 @@
 computeExpiration(const ndn::PrefixAnnouncement& ann)
 {
   auto validityEnd = time::steady_clock::duration::max();
-  if (ann.getValidityPeriod()) {
+  const auto& validityPeriod = ann.getValidityPeriod();
+  if (validityPeriod) {
     auto now = time::system_clock::now();
-    if (!ann.getValidityPeriod()->isValid(now)) {
+    if (!validityPeriod->isValid(now)) {
       validityEnd = time::steady_clock::duration::zero();
     }
     else {
-      validityEnd = ann.getValidityPeriod()->getPeriod().second - now;
+      validityEnd = validityPeriod->getPeriod().second - now;
     }
   }
   return time::steady_clock::now() +
@@ -62,8 +63,8 @@
 std::ostream&
 operator<<(std::ostream& os, const Route& route)
 {
-  os << "Route("
-     << "faceid: " << route.faceId
+  os << "Route{"
+     << "face: " << route.faceId
      << ", origin: " << route.origin
      << ", cost: " << route.cost
      << ", flags: " << ndn::AsHex{route.flags};
@@ -72,14 +73,14 @@
     os << ", expires in: " << time::duration_cast<time::milliseconds>(*route.expires - time::steady_clock::now());
   }
   else {
-    os << ", never expires";
+    os << ", expires: never";
   }
 
   if (route.announcement) {
     os << ", announcement: (" << *route.announcement << ')';
   }
 
-  return os << ')';
+  return os << '}';
 }
 
 } // namespace nfd::rib
