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/platform_config.cpp b/libpldmresponder/platform_config.cpp
index 5c46199..8bc6b06 100644
--- a/libpldmresponder/platform_config.cpp
+++ b/libpldmresponder/platform_config.cpp
@@ -1,5 +1,9 @@
 #include "platform_config.hpp"
 
+#include <phosphor-logging/lg2.hpp>
+
+PHOSPHOR_LOG2_USING;
+
 namespace pldm
 {
 namespace responder
@@ -109,7 +113,7 @@
             catch (const std::exception& e)
             {
                 error(
-                    "Error getting Names property at '{PATH}' on '{INTERFACE}': {ERROR}",
+                    "Failed to get Names property at '{PATH}' on interface '{INTERFACE}', error - {ERROR}",
                     "PATH", objectPath, "INTERFACE", compatibleInterface,
                     "ERROR", e);
             }
@@ -117,8 +121,9 @@
     }
     catch (const std::exception& e)
     {
-        error("Failed to make a d-bus call to get platform name {ERROR}",
-              "ERROR", e);
+        error(
+            "Failed to make a d-bus call to get platform name, error - {ERROR}",
+            "ERROR", e);
     }
     return std::nullopt;
 }