summaryrefslogtreecommitdiffstats
path: root/extensions
diff options
context:
space:
mode:
authorMatt Spinler <spinler@us.ibm.com>2019-10-21 12:22:49 -0500
committerMatt Spinler <spinler@us.ibm.com>2019-11-04 16:14:16 -0600
commit67456c2baa53c96118cd0565a8ec0f3814b38f68 (patch)
tree50cc3c84db0f1e31d52a8ee6826c7c2e1c6f8ce5 /extensions
parentbd716f00dbdf910da44935785611b49c8719249c (diff)
downloadphosphor-logging-67456c2baa53c96118cd0565a8ec0f3814b38f68.tar.gz
phosphor-logging-67456c2baa53c96118cd0565a8ec0f3814b38f68.zip
PEL: Start creating PELs from event logs
Look up incoming OpenBMC event logs in the message registry and create PELs for them if a registry entry is found. What happens when an event log can't be found in the message registry, such as creating a different PEL, will be addressed in a separate commit. Signed-off-by: Matt Spinler <spinler@us.ibm.com> Change-Id: I45c634830021fdf2efb54e3cbfd6d496fd3d7d01
Diffstat (limited to 'extensions')
-rw-r--r--extensions/openpower-pels/manager.cpp15
1 files changed, 14 insertions, 1 deletions
diff --git a/extensions/openpower-pels/manager.cpp b/extensions/openpower-pels/manager.cpp
index fd3670c..2141a71 100644
--- a/extensions/openpower-pels/manager.cpp
+++ b/extensions/openpower-pels/manager.cpp
@@ -110,7 +110,20 @@ void Manager::createPEL(const std::string& message, uint32_t obmcLogID,
const std::vector<std::string>& additionalData,
const std::vector<std::string>& associations)
{
- // TODO: look up the error in _registry and create a PEL
+ auto entry = _registry.lookup(message);
+
+ if (entry)
+ {
+ AdditionalData ad{additionalData};
+
+ auto pel =
+ std::make_unique<PEL>(*entry, obmcLogID, timestamp, severity, ad);
+
+ _repo.add(pel);
+ }
+
+ // TODO ibm-openbmc/dev/1151: When the message registry is actually filled
+ // in, handle the case where an error isn't in it.
}
} // namespace pels
OpenPOWER on IntegriCloud