pldmd, requester, softoff & utilities: 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: I230e9e1404db8c92c81e2f872183d691c91ff16c
Signed-off-by: Riya Dixit <riyadixitagra@gmail.com>
diff --git a/requester/mctp_endpoint_discovery.cpp b/requester/mctp_endpoint_discovery.cpp
index 0d63cb2..0d63ad4 100644
--- a/requester/mctp_endpoint_discovery.cpp
+++ b/requester/mctp_endpoint_discovery.cpp
@@ -48,8 +48,9 @@
}
catch (const sdbusplus::exception_t& e)
{
- error("getSubtree call failed with, {ERROR} {PATH} {INTERFACE}",
- "ERROR", e, "PATH", MCTPPath, "INTERFACE", MCTPInterface);
+ error(
+ "Failed to getSubtree call at path '{PATH}' and interface '{INTERFACE}', error - {ERROR} ",
+ "ERROR", e, "PATH", MCTPPath, "INTERFACE", MCTPInterface);
return;
}
@@ -76,8 +77,9 @@
if (std::find(types.begin(), types.end(), mctpTypePLDM) !=
types.end())
{
- info("Adding Endpoint networkId={NETWORK} EID={EID}",
- "NETWORK", networkId, "EID", unsigned(eid));
+ info(
+ "Adding Endpoint networkId '{NETWORK}' and EID '{EID}'",
+ "NETWORK", networkId, "EID", unsigned(eid));
mctpInfos.emplace_back(
MctpInfo(eid, emptyUUID, "", networkId));
}
@@ -86,7 +88,7 @@
catch (const sdbusplus::exception_t& e)
{
error(
- "Error reading MCTP Endpoint property, {ERROR} {SERVICE} {PATH}",
+ "Error reading MCTP Endpoint property at path '{PATH}' and service '{SERVICE}', error - {ERROR}",
"ERROR", e, "SERVICE", service, "PATH", path);
return;
}
@@ -109,8 +111,9 @@
}
catch (const sdbusplus::exception_t& e)
{
- error("Error reading MCTP Endpoint addedInterace message, {ERROR}",
- "ERROR", e);
+ error(
+ "Error reading MCTP Endpoint added interface message, error - {ERROR}",
+ "ERROR", e);
return;
}
@@ -130,8 +133,9 @@
if (std::find(types.begin(), types.end(), mctpTypePLDM) !=
types.end())
{
- info("Adding Endpoint networkId={NETWORK} EID={EID}",
- "NETWORK", networkId, "EID", unsigned(eid));
+ info(
+ "Adding Endpoint networkId '{NETWORK}' and EID '{EID}'",
+ "NETWORK", networkId, "EID", unsigned(eid));
mctpInfos.emplace_back(
MctpInfo(eid, emptyUUID, "", networkId));
}
@@ -165,8 +169,9 @@
}
for (const auto& mctpInfo : removedInfos)
{
- info("Removing Endpoint networkId={NETWORK} EID={EID}", "NETWORK",
- std::get<3>(mctpInfo), "EID", unsigned(std::get<0>(mctpInfo)));
+ info("Removing Endpoint networkId '{NETWORK}' and EID '{EID}'",
+ "NETWORK", std::get<3>(mctpInfo), "EID",
+ unsigned(std::get<0>(mctpInfo)));
existingMctpInfos.erase(std::remove(existingMctpInfos.begin(),
existingMctpInfos.end(), mctpInfo),
existingMctpInfos.end());