PEL: Trace when event logs don't create PELs

To help show which events are missing from the PEL message registry,
add a journal entry for when an OpenBMC event log name isn't found
in the registry and a PEL won't be created.  Eventually, this will
be replaced with creating a brand new PEL that contains the event
log info.

In addition, add a journal entry displaying the SRC ASCII string of
newly created PELs.

Signed-off-by: Matt Spinler <spinler@us.ibm.com>
Change-Id: I1228339cfa7d1d5aa60ef3b3ce2b2c0424ab0bf4
diff --git a/extensions/openpower-pels/manager.cpp b/extensions/openpower-pels/manager.cpp
index 0c94317..b9c7d94 100644
--- a/extensions/openpower-pels/manager.cpp
+++ b/extensions/openpower-pels/manager.cpp
@@ -126,6 +126,7 @@
                         const std::vector<std::string>& associations)
 {
     auto entry = _registry.lookup(message);
+    std::string msg;
 
     if (entry)
     {
@@ -135,10 +136,28 @@
                                          ad, *_dataIface);
 
         _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.
+        auto src = pel->primarySRC();
+        if (src)
+        {
+            using namespace std::literals::string_literals;
+            char id[11];
+            sprintf(id, "0x%08X", pel->id());
+            msg = "Created PEL "s + id + " with SRC "s + (*src)->asciiString();
+            while (msg.back() == ' ')
+            {
+                msg.pop_back();
+            }
+            log<level::INFO>(msg.c_str());
+        }
+    }
+    else
+    {
+        // TODO ibm-openbmc/dev/1151: Create a new PEL for this case.
+        // For now, just trace it.
+        msg = "Event not found in PEL message registry: " + message;
+        log<level::INFO>(msg.c_str());
+    }
 }
 
 } // namespace pels