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/extended_user_data.cpp b/extensions/openpower-pels/extended_user_data.cpp
index 441993a..92d1c70 100644
--- a/extensions/openpower-pels/extended_user_data.cpp
+++ b/extensions/openpower-pels/extended_user_data.cpp
@@ -19,15 +19,13 @@
#ifdef PELTOOL
#include "user_data_json.hpp"
#endif
-#include <phosphor-logging/log.hpp>
+#include <phosphor-logging/lg2.hpp>
#include <format>
namespace openpower::pels
{
-using namespace phosphor::logging;
-
void ExtendedUserData::unflatten(Stream& stream)
{
stream >> _header;
@@ -60,10 +58,8 @@
}
catch (const std::exception& e)
{
- log<level::ERR>(
- std::format("Cannot unflatten ExtendedUserData section: {}",
- e.what())
- .c_str());
+ lg2::error("Cannot unflatten ExtendedUserData section: {EXCEPTION}",
+ "EXCEPTION", e);
_valid = false;
}
}
@@ -89,10 +85,8 @@
{
if (header().id != static_cast<uint16_t>(SectionID::extUserData))
{
- log<level::ERR>(
- std::format("Invalid ExtendedUserData section ID: {0:#x}",
- header().id)
- .c_str());
+ lg2::error("Invalid ExtendedUserData section ID: {HEADER_ID}",
+ "HEADER_ID", lg2::hex, header().id);
_valid = false;
}
else