entry: use map for metadata in ctor
Transition the entry constructor to use the `map<string,string>`
rather than the `vector<string>`.
Tested: UTs pass and daemon still creates logs.
Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
Change-Id: Icf3ead163cc99a1498734d33335fb6da52e6c98c
diff --git a/lib/lg2_commit.cpp b/lib/lg2_commit.cpp
index 2f1caab..6916bf5 100644
--- a/lib/lg2_commit.cpp
+++ b/lib/lg2_commit.cpp
@@ -107,18 +107,9 @@
}
auto extractEvent(sdbusplus::exception::generated_event_base&& t)
- -> std::tuple<std::string, Entry::Level, std::vector<std::string>>
+ -> std::tuple<std::string, Entry::Level, std::map<std::string, std::string>>
{
- auto data = data_from_json(t);
- std::vector<std::string> additional_data = {};
-
- for (auto& [key, data] : data)
- {
- additional_data.emplace_back(key + "=" + data);
- }
-
- return {t.name(), severity_from_syslog(t.severity()),
- std::move(additional_data)};
+ return {t.name(), severity_from_syslog(t.severity()), data_from_json(t)};
}
} // namespace details