summaryrefslogtreecommitdiffstats
path: root/elog_serialize.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'elog_serialize.cpp')
-rw-r--r--elog_serialize.cpp19
1 files changed, 16 insertions, 3 deletions
diff --git a/elog_serialize.cpp b/elog_serialize.cpp
index 1af1946..d807a93 100644
--- a/elog_serialize.cpp
+++ b/elog_serialize.cpp
@@ -29,7 +29,8 @@ template<class Archive>
void save(Archive& a, const Entry& e, const std::uint32_t version)
{
a(e.id(), e.severity(), e.timestamp(),
- e.message(), e.additionalData(), e.associations(), e.resolved());
+ e.message(), e.additionalData(), e.associations(), e.resolved(),
+ e.version());
}
/** @brief Function required by Cereal to perform deserialization.
@@ -52,9 +53,18 @@ void load(Archive& a, Entry& e, const std::uint32_t version)
std::vector<std::string> additionalData{};
bool resolved{};
AssociationList associations{};
+ std::string fwVersion{};
- a(id, severity, timestamp, message,
- additionalData, associations, resolved);
+ if (version < std::stoul(FIRST_CEREAL_CLASS_VERSION_WITH_FWLEVEL))
+ {
+ a(id, severity, timestamp, message,
+ additionalData, associations, resolved);
+ }
+ else
+ {
+ a(id, severity, timestamp, message,
+ additionalData, associations, resolved, fwVersion);
+ }
e.id(id);
e.severity(severity);
@@ -64,6 +74,9 @@ void load(Archive& a, Entry& e, const std::uint32_t version)
e.sdbusplus::xyz::openbmc_project::
Logging::server::Entry::resolved(resolved);
e.associations(associations);
+ e.version(fwVersion);
+ e.purpose(sdbusplus::xyz::openbmc_project::Software::
+ server::Version::VersionPurpose::BMC);
}
fs::path serialize(const Entry& e, const fs::path& dir)
OpenPOWER on IntegriCloud