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/bios_integer_attribute.cpp b/libpldmresponder/bios_integer_attribute.cpp
index fa338dc..8c343c7 100644
--- a/libpldmresponder/bios_integer_attribute.cpp
+++ b/libpldmresponder/bios_integer_attribute.cpp
@@ -37,10 +37,10 @@
     if (rc != PLDM_SUCCESS)
     {
         error(
-            "Wrong field for integer attribute, ATTRIBUTE_NAME={ATTR_NAME} ERRMSG= {ERR_MSG} LOWER_BOUND={LOW_BOUND} UPPER_BOUND={UPPER_BOUND} DEFAULT_VALUE={DEF_VAL} SCALAR_INCREMENT={SCALAR_INCREMENT}",
-            "ATTR_NAME", attr.c_str(), "ERR_MSG", errmsg, "LOW_BOUND",
+            "Wrong field for integer attribute '{ATTRIBUTE}', error '{ERROR}', lower bound '{LOW_BOUND}', upper bound '{UPPER_BOUND}', default value '{DEFAULT_VALUE}' and scalar increament '{SCALAR_INCREMENT}'",
+            "ATTRIBUTE", attr, "ERROR", errmsg, "LOW_BOUND",
             integerInfo.lowerBound, "UPPER_BOUND", integerInfo.upperBound,
-            "DEF_VAL", integerInfo.defaultValue, "SCALAR_INCREMENT",
+            "DEFAULT_VALUE", integerInfo.defaultValue, "SCALAR_INCREMENT",
             integerInfo.scalarIncrement);
         throw std::invalid_argument("Wrong field for integer attribute");
     }
@@ -97,7 +97,7 @@
                                             static_cast<double>(currentValue));
     }
 
-    error("Unsupported property type on dbus: {DBUS_PROP}", "DBUS_PROP",
+    error("Unsupported property type '{TYPE}' on dbus", "TYPE",
           dBusMap->propertyType);
     throw std::invalid_argument("dbus type error");
 }
@@ -177,8 +177,8 @@
     }
     else
     {
-        error("Unsupported property type for getAttrValue: {DBUS_PROP}",
-              "DBUS_PROP", dBusMap->propertyType);
+        error("Unsupported property type '{TYPE}' for getAttrValue", "TYPE",
+              dBusMap->propertyType);
         throw std::invalid_argument("dbus type error");
     }
     return value;
@@ -202,8 +202,9 @@
     catch (const std::exception& e)
     {
         error(
-            "Error getting integer attribute '{ATTR}' from '{INTERFACE}': {ERROR}",
-            "ATTR", name, "INTERFACE", dBusMap->interface, "ERROR", e);
+            "Error getting integer attribute '{ATTRIBUTE}' at path '{PATH}' and interface '{INTERFACE}' for property '{PROPERTY}', error - {ERROR}",
+            "ATTRIBUTE", name, "PATH", dBusMap->objectPath, "INTERFACE",
+            dBusMap->interface, "PROPERTY", dBusMap->propertyName, "ERROR", e);
         return integerInfo.defaultValue;
     }
 }