libpldmresponder: Improving Logs (lg2)
This commit corrects the severity level of logs and also formats the
message string, fixing the ill-defined message string of the logs as
mentioned in the anti-pattern document [1]. Additionally, based on the
requirement this commit adds more debug information to logs.
[1]: https://github.com/openbmc/docs/blob/master/anti-patterns.md#ill-defined-data-structuring-in-lg2-message-strings
Change-Id: I7dc5c308a8cd76573995e07d01d1a6037bca31ba
Signed-off-by: Riya Dixit <riyadixitagra@gmail.com>
diff --git a/libpldmresponder/pdr_state_sensor.hpp b/libpldmresponder/pdr_state_sensor.hpp
index ea24497..dd9a992 100644
--- a/libpldmresponder/pdr_state_sensor.hpp
+++ b/libpldmresponder/pdr_state_sensor.hpp
@@ -42,7 +42,7 @@
if (!statesSize)
{
error(
- "Malformed PDR JSON return pdrEntry;- no state set info, TYPE={STATE_SENSOR_PDR}",
+ "Malformed PDR JSON return pdrEntry; no state set info for state sensor pdr '{STATE_SENSOR_PDR}'",
"STATE_SENSOR_PDR",
static_cast<int>(PLDM_STATE_SENSOR_PDR));
throw InternalFailure();
@@ -169,7 +169,7 @@
catch (const std::exception& e)
{
error(
- "Failed to create sensor PDR, D-Bus object '{PATH}' returned {ERROR}",
+ "Failed to create sensor PDR, D-Bus object '{PATH}' returned error - {ERROR}",
"PATH", objectPath, "ERROR", e);
break;
}