Updated Miscellaneous Journal Traces to lg2
Update the logging API used for files not in
phosphor-fan-presence/presence, phosphor-fan-presence/monitor,
or phosphor-fan-presence/control from the older phosphor::logging::log
to the more recent lg2::log.
Tested:
* Verified journal traces worked correctly in simulation and on
physical hardware.
* Modified json config files to force parsing and sensor-monitor
errors and verified correct output and key/value pairs in the
journalctl output.
Change-Id: Ie68ac5733ecd20d5f17882020df861a975121f77
Signed-off-by: Anwaar Hadi <anwaar.hadi@ibm.com>
diff --git a/evdevpp/evdev.hpp b/evdevpp/evdev.hpp
index 543729c..e68ad7c 100644
--- a/evdevpp/evdev.hpp
+++ b/evdevpp/evdev.hpp
@@ -6,6 +6,7 @@
#include <phosphor-logging/elog-errors.hpp>
#include <phosphor-logging/elog.hpp>
+#include <phosphor-logging/lg2.hpp>
#include <xyz/openbmc_project/Common/error.hpp>
#include <memory>
@@ -74,8 +75,9 @@
auto rc = libevdev_fetch_event_value(evdev.get(), type, code, &val);
if (!rc)
{
- log<level::ERR>("Error in call to libevdev_fetch_event_value",
- entry("TYPE=%d", type), entry("CODE=%d", code));
+ lg2::error(
+ "Error in call to libevdev_fetch_event_value, Type={TYPE}, Code={CODE}",
+ "TYPE", type, "CODE", code);
elog<InternalFailure>();
}
@@ -92,8 +94,8 @@
LIBEVDEV_READ_FLAG_NORMAL, &ev);
if (rc < 0)
{
- log<level::ERR>("Error in call to libevdev_next_event",
- entry("RC=%d", rc));
+ lg2::error("Error in call to libevdev_next_event, RC={RC}",
+ "RC", rc);
elog<InternalFailure>();
}
@@ -124,8 +126,8 @@
if (rc)
{
- log<level::ERR>("Error in call to libevdev_new_from_fd",
- entry("RC=%d", rc), entry("FD=%d", fd));
+ lg2::error("Error in call to libevdev_new_from_fd, RC={RC}, FD={FD}",
+ "RC", rc, "FD", fd);
elog<InternalFailure>();
}