PLDM: Implementing Phosphor-Logging/LG2 logging

This commit migrates std::cerr/cout added as part
of new changes in PLDM to LG2.

Change-Id: I8e85732684d47b6740521e95712433a7c6760d8a
Signed-off-by: Riya Dixit <riyadixitagra@gmail.com>
diff --git a/libpldmresponder/bios_integer_attribute.cpp b/libpldmresponder/bios_integer_attribute.cpp
index 6611389..258a188 100644
--- a/libpldmresponder/bios_integer_attribute.cpp
+++ b/libpldmresponder/bios_integer_attribute.cpp
@@ -37,7 +37,7 @@
     if (rc != PLDM_SUCCESS)
     {
         error(
-            "Wrong filed 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}",
+            "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",
             integerInfo.lowerBound, "UPPER_BOUND", integerInfo.upperBound,
             "DEF_VAL", integerInfo.defaultValue, "SCALAR_INCREMENT",
diff --git a/libpldmresponder/fru.cpp b/libpldmresponder/fru.cpp
index a716f5d..98f696c 100644
--- a/libpldmresponder/fru.cpp
+++ b/libpldmresponder/fru.cpp
@@ -65,7 +65,7 @@
     while (!tmpObj.empty())
     {
         std::string s = tmpObj.top();
-        std::cout << s << std::endl;
+        info("{TMP_OBJ_STR}", "TMP_OBJ_PATH", s);
         tmpObj.pop();
     }
     // Update pldm entity to assocition tree
@@ -208,7 +208,7 @@
                 }
                 catch (const std::exception& e)
                 {
-                    info(
+                    error(
                         "Config JSONs missing for the item interface type, interface = {INTF}",
                         "INTF", interface.first);
                     break;
diff --git a/libpldmresponder/pdr_numeric_effecter.hpp b/libpldmresponder/pdr_numeric_effecter.hpp
index 0347af4..88d7f8a 100644
--- a/libpldmresponder/pdr_numeric_effecter.hpp
+++ b/libpldmresponder/pdr_numeric_effecter.hpp
@@ -78,8 +78,7 @@
                 // present
                 if (!pdr->entity_type)
                 {
-                    std::cerr << "The entity path for the FRU is not present."
-                              << std::endl;
+                    error("The entity path for the FRU is not present.");
                     continue;
                 }
             }
diff --git a/libpldmresponder/pdr_state_effecter.hpp b/libpldmresponder/pdr_state_effecter.hpp
index 1dc2250..2a6f86e 100644
--- a/libpldmresponder/pdr_state_effecter.hpp
+++ b/libpldmresponder/pdr_state_effecter.hpp
@@ -96,8 +96,7 @@
                 // present
                 if (!pdr->entity_type)
                 {
-                    std::cerr << "The entity path for the FRU is not present."
-                              << std::endl;
+                    error("The entity path for the FRU is not present.");
                     continue;
                 }
             }
diff --git a/libpldmresponder/pdr_state_sensor.hpp b/libpldmresponder/pdr_state_sensor.hpp
index bda3964..b75757e 100644
--- a/libpldmresponder/pdr_state_sensor.hpp
+++ b/libpldmresponder/pdr_state_sensor.hpp
@@ -99,8 +99,7 @@
                 // present
                 if (!pdr->entity_type)
                 {
-                    std::cerr << "The entity path for the FRU is not present."
-                              << std::endl;
+                    error("The entity path for the FRU is not present.");
                     continue;
                 }
             }
diff --git a/libpldmresponder/test/libpldmresponder_platform_test.cpp b/libpldmresponder/test/libpldmresponder_platform_test.cpp
index 0c9b324..a646f9d 100644
--- a/libpldmresponder/test/libpldmresponder_platform_test.cpp
+++ b/libpldmresponder/test/libpldmresponder_platform_test.cpp
@@ -197,13 +197,10 @@
                                            // current is not what we want
 
         pldm_pdr_hdr* hdr = reinterpret_cast<pldm_pdr_hdr*>(resp->record_data);
-        std::cerr << "PDR next record handle " << handle << "\n";
-        std::cerr << "PDR type " << hdr->type << "\n";
         if (hdr->type == PLDM_STATE_EFFECTER_PDR)
         {
             pldm_state_effecter_pdr* pdr =
                 reinterpret_cast<pldm_state_effecter_pdr*>(resp->record_data);
-            std::cerr << "PDR entity type " << pdr->entity_type << "\n";
             if (pdr->entity_type == 100)
             {
                 found = true;