]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
Beter naming of closure 11660/head
authorOtto Moerbeek <otto@drijf.net>
Fri, 10 Jun 2022 06:32:23 +0000 (08:32 +0200)
committerOtto Moerbeek <otto@drijf.net>
Fri, 10 Jun 2022 06:32:23 +0000 (08:32 +0200)
pdns/recursordist/rec-main.cc

index dfd16a7617b9161a7fc67e1f9155c3b75db4bd3e..8caeef9941280dbff81682d15a73facc28487450 100644 (file)
@@ -880,26 +880,26 @@ static void loggerSDBackend(const Logging::Entry& entry)
 {
   // We need to keep the string in mem until sd_journal_sendv has ben called
   vector<string> strings;
-  auto h = [&strings](const string& k, const string& v) {
+  auto appendKeyAndVal = [&strings](const string& k, const string& v) {
     strings.emplace_back(k + "=" + v);
   };
-  h("MESSAGE", entry.message);
+  appendKeyAndVal("MESSAGE", entry.message);
   if (entry.error) {
-    h("ERROR", entry.error.get());
+    appendKeyAndVal("ERROR", entry.error.get());
   }
-  h("LEVEL", std::to_string(entry.level));
-  h("PRIORITY", std::to_string(entry.d_priority));
+  appendKeyAndVal("LEVEL", std::to_string(entry.level));
+  appendKeyAndVal("PRIORITY", std::to_string(entry.d_priority));
   if (entry.name) {
-    h("SUBSYSTEM", entry.name.get());
+    appendKeyAndVal("SUBSYSTEM", entry.name.get());
   }
   char timebuf[64];
-  h("TIMESTAMP", toTimestampStringMilli(entry.d_timestamp, timebuf, sizeof(timebuf)));
+  appendKeyAndVal("TIMESTAMP", toTimestampStringMilli(entry.d_timestamp, timebuf, sizeof(timebuf)));
   for (auto const& v : entry.values) {
-    h(toUpper(v.first), v.second);
+    appendKeyAndVal(toUpper(v.first), v.second);
   }
   // Thread id filled in by backend, since the SL code does not know about RecursorThreads
   // We use the Recursor thread, other threads get id 0. May need to revisit.
-  h("TID", std::to_string(RecThreadInfo::id()));
+  appendKeyAndVal("TID", std::to_string(RecThreadInfo::id()));
 
   vector<iovec> iov;
   iov.reserve(strings.size());