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_effecter.hpp b/libpldmresponder/pdr_state_effecter.hpp
index 17a7af9..4e3031a 100644
--- a/libpldmresponder/pdr_state_effecter.hpp
+++ b/libpldmresponder/pdr_state_effecter.hpp
@@ -43,7 +43,7 @@
if (!statesSize)
{
error(
- "Malformed PDR JSON return pdrEntry;- no state set info, TYPE={STATE_EFFECTER_PDR}",
+ "Malformed PDR JSON return pdrEntry; no state set info for state effecter pdr '{STATE_EFFECTER_PDR}'",
"STATE_EFFECTER_PDR",
static_cast<unsigned>(PLDM_STATE_EFFECTER_PDR));
throw InternalFailure();
@@ -158,7 +158,7 @@
catch (const std::exception& e)
{
error(
- "Failed to create effecter PDR, D-Bus object '{PATH}' returned {ERROR}",
+ "Failed to create effecter PDR, D-Bus object '{PATH}' returned error - {ERROR}",
"PATH", objectPath, "ERROR", e);
break;
}