MaybeNodeName looks useful to be shared

It included trailing space for printing, but it will be used not only
for printing, so messages are adjusted accordingly.

Change-Id: I39bd50775f59b8055d21ccab8745046c0a654450
Signed-off-by: James Kuszmaul <james.kuszmaul@bluerivertech.com>
diff --git a/aos/events/logging/logfile_utils.cc b/aos/events/logging/logfile_utils.cc
index cda6561..b76bcad 100644
--- a/aos/events/logging/logfile_utils.cc
+++ b/aos/events/logging/logfile_utils.cc
@@ -1785,8 +1785,8 @@
 
         std::optional<size_t> boot = parts_message_reader_.boot_count(
             source_node_index_[m->channel_index]);
-        CHECK(boot) << ": Failed to find boot for node " << MaybeNodeName(node)
-                    << ", with index " << source_node_index_[m->channel_index];
+        CHECK(boot) << ": Failed to find boot for node '" << MaybeNodeName(node)
+                    << "', with index " << source_node_index_[m->channel_index];
         monotonic_remote_boot = *boot;
       }
 
@@ -2501,11 +2501,4 @@
   return ss.str();
 }
 
-std::string MaybeNodeName(const Node *node) {
-  if (node != nullptr) {
-    return node->name()->str() + " ";
-  }
-  return "";
-}
-
 }  // namespace aos::logger