PEL: Changing the remaining traces to lg2 style

Some of the logging traces of PEL files still uses old style of logging.

Changing the remaining traces in PEL files to lg2 style of logging.Some
of the traces in phosphor logging code which use the old style is also
considered.

Change-Id: I0daf9589af443881cb61730047c23db17fdec2c3
Signed-off-by: Arya K Padman <aryakpadman@gmail.com>
diff --git a/extensions/openpower-pels/private_header.cpp b/extensions/openpower-pels/private_header.cpp
index 1b4fdbb..e32719f 100644
--- a/extensions/openpower-pels/private_header.cpp
+++ b/extensions/openpower-pels/private_header.cpp
@@ -20,7 +20,7 @@
 #include "pel_types.hpp"
 #include "pel_values.hpp"
 
-#include <phosphor-logging/log.hpp>
+#include <phosphor-logging/lg2.hpp>
 
 #include <format>
 
@@ -30,7 +30,6 @@
 {
 
 namespace pv = openpower::pels::pel_values;
-using namespace phosphor::logging;
 
 PrivateHeader::PrivateHeader(uint16_t componentID, uint32_t obmcLogID,
                              uint64_t timestamp)
@@ -79,9 +78,8 @@
     }
     catch (const std::exception& e)
     {
-        log<level::ERR>(
-            std::format("Cannot unflatten private header: {}", e.what())
-                .c_str());
+        lg2::error("Cannot unflatten private header: {EXCEPTION}", "EXCEPTION",
+                   e);
         _valid = false;
     }
 }
@@ -129,26 +127,22 @@
 
     if (header().id != static_cast<uint16_t>(SectionID::privateHeader))
     {
-        log<level::ERR>(std::format("Invalid private header section ID: {0:#x}",
-                                    header().id)
-                            .c_str());
+        lg2::error("Invalid private header section ID: {HEADER_ID}",
+                   "HEADER_ID", lg2::hex, header().id);
         failed = true;
     }
 
     if (header().version != privateHeaderVersion)
     {
-        log<level::ERR>(std::format("Invalid private header version: {0:#x}",
-                                    header().version)
-                            .c_str());
+        lg2::error("Invalid private header version: {HEADER_VERSION}",
+                   "HEADER_VERSION", lg2::hex, header().version);
         failed = true;
     }
 
     if (_sectionCount < minSectionCount)
     {
-        log<level::ERR>(
-            std::format("Invalid section count in private header: {0:#x}",
-                        _sectionCount)
-                .c_str());
+        lg2::error("Invalid section count in private header: {SECTION_COUNT}",
+                   "SECTION_COUNT", lg2::hex, _sectionCount);
         failed = true;
     }