pldm: Remove unnecessary type casting in logs

This commit removes the unnecessary type casting of values of the
journal logs based on supported types mentioned in LG2 documentation
[1].

Testing: Verified the debug traces to correct.

'''
For Instance:
Earlier -
error(”TYPE = {TYPE} “, “TYPE”, static_cast<unsigned>(PLDM_STATE_EFFECTER_PDR));
Journal trace -
May 27 08:16:51 p10bmc pldmd[931]: TYPE = 11

After Correction -
error(”TYPE = {TYPE}“, “TYPE”, PLDM_STATE_EFFECTER_PDR);
Journal trace -
May 27 08:16:51 p10bmc pldmd[931]: TYPE = Enum(11)
'''

[1]: https://github.com/openbmc/phosphor-logging/blob/master/docs/structured-logging.md#lg2

Change-Id: Ia649ecd4ecbb73c421f7844885f58a6835805719
Signed-off-by: Riya Dixit <riyadixitagra@gmail.com>
diff --git a/fw-update/device_updater.cpp b/fw-update/device_updater.cpp
index 738b4af..49b6326 100644
--- a/fw-update/device_updater.cpp
+++ b/fw-update/device_updater.cpp
@@ -52,7 +52,7 @@
         updateManager->instanceIdDb.free(eid, instanceId);
         error(
             "Failed to encode request update request for endpoint ID '{EID}', response code '{RC}'",
-            "EID", unsigned(eid), "RC", rc);
+            "EID", eid, "RC", rc);
     }
 
     rc = updateManager->handler.registerRequest(
@@ -63,7 +63,7 @@
         // Handle error scenario
         error(
             "Failed to send request update for endpoint ID '{EID}', response code '{RC}'",
-            "EID", unsigned(eid), "RC", rc);
+            "EID", eid, "RC", rc);
     }
 }
 
@@ -74,7 +74,7 @@
     {
         // Handle error scenario
         error("No response received for request update for endpoint ID '{EID}'",
-              "EID", unsigned(eid));
+              "EID", eid);
         return;
     }
 
@@ -88,14 +88,14 @@
     {
         error(
             "Failed to decode request update response for endpoint ID '{EID}', response code '{RC}'",
-            "EID", unsigned(eid), "RC", rc);
+            "EID", eid, "RC", rc);
         return;
     }
     if (completionCode)
     {
         error(
             "Failure in request update response for endpoint ID '{EID}', completion code '{CC}'",
-            "EID", unsigned(eid), "CC", unsigned(completionCode));
+            "EID", eid, "CC", completionCode);
         return;
     }
 
@@ -180,7 +180,7 @@
         updateManager->instanceIdDb.free(eid, instanceId);
         error(
             "Failed to encode pass component table req for endpoint ID '{EID}', response code '{RC}'",
-            "EID", unsigned(eid), "RC", rc);
+            "EID", eid, "RC", rc);
     }
 
     rc = updateManager->handler.registerRequest(
@@ -192,7 +192,7 @@
         // Handle error scenario
         error(
             "Failed to send pass component table request for endpoint ID '{EID}', response code '{RC}'",
-            "EID", unsigned(eid), "RC", rc);
+            "EID", eid, "RC", rc);
     }
 }
 
@@ -204,7 +204,7 @@
         // Handle error scenario
         error(
             "No response received for pass component table for endpoint ID '{EID}'",
-            "EID", unsigned(eid));
+            "EID", eid);
         return;
     }
 
@@ -220,7 +220,7 @@
         // Handle error scenario
         error(
             "Failed to decode pass component table response for endpoint ID '{EID}', response code '{RC}'",
-            "EID", unsigned(eid), "RC", rc);
+            "EID", eid, "RC", rc);
         return;
     }
     if (completionCode)
@@ -228,7 +228,7 @@
         // Handle error scenario
         error(
             "Failed to pass component table response for endpoint ID '{EID}', completion code '{CC}'",
-            "EID", unsigned(eid), "CC", unsigned(completionCode));
+            "EID", eid, "CC", completionCode);
         return;
     }
     // Handle ComponentResponseCode
@@ -312,7 +312,7 @@
         updateManager->instanceIdDb.free(eid, instanceId);
         error(
             "Failed to encode update component req for endpoint ID '{EID}', response code '{RC}'",
-            "EID", unsigned(eid), "RC", rc);
+            "EID", eid, "RC", rc);
     }
 
     rc = updateManager->handler.registerRequest(
@@ -323,7 +323,7 @@
         // Handle error scenario
         error(
             "Failed to send update request for endpoint ID '{EID}', response code '{RC}'",
-            "EID", unsigned(eid), "RC", rc);
+            "EID", eid, "RC", rc);
     }
 }
 
@@ -335,7 +335,7 @@
         // Handle error scenario
         error(
             "No response received for update component with endpoint ID {EID}",
-            "EID", unsigned(eid));
+            "EID", eid);
         return;
     }
 
@@ -353,14 +353,14 @@
     {
         error(
             "Failed to decode update request response for endpoint ID '{EID}', response code '{RC}'",
-            "EID", unsigned(eid), "RC", rc);
+            "EID", eid, "RC", rc);
         return;
     }
     if (completionCode)
     {
         error(
             "Failed to update request response for endpoint ID '{EID}', completion code '{CC}'",
-            "EID", unsigned(eid), "CC", unsigned(completionCode));
+            "EID", eid, "CC", completionCode);
         return;
     }
 }
@@ -379,7 +379,7 @@
     {
         error(
             "Failed to decode request firmware date request for endpoint ID '{EID}', response code '{RC}'",
-            "EID", unsigned(eid), "RC", rc);
+            "EID", eid, "RC", rc);
         rc = encode_request_firmware_data_resp(
             request->hdr.instance_id, PLDM_ERROR_INVALID_DATA, responseMsg,
             sizeof(completionCode));
@@ -387,7 +387,7 @@
         {
             error(
                 "Failed to encode request firmware date response for endpoint ID '{EID}', response code '{RC}'",
-                "EID", unsigned(eid), "RC", rc);
+                "EID", eid, "RC", rc);
         }
         return response;
     }
@@ -398,7 +398,7 @@
     auto compOffset = std::get<5>(comp);
     auto compSize = std::get<6>(comp);
     info("Decoded fw request data at offset '{OFFSET}' and length '{LENGTH}' ",
-         "OFFSET", unsigned(offset), "LENGTH", unsigned(length));
+         "OFFSET", offset, "LENGTH", length);
     if (length < PLDM_FWUP_BASELINE_TRANSFER_SIZE || length > maxTransferSize)
     {
         rc = encode_request_firmware_data_resp(
@@ -408,7 +408,7 @@
         {
             error(
                 "Failed to encode request firmware date response for endpoint ID '{EID}', response code '{RC}'",
-                "EID", unsigned(eid), "RC", rc);
+                "EID", eid, "RC", rc);
         }
         return response;
     }
@@ -422,7 +422,7 @@
         {
             error(
                 "Failed to encode request firmware date response for endpoint ID '{EID}', response code '{RC}'",
-                "EID", unsigned(eid), "RC", rc);
+                "EID", eid, "RC", rc);
         }
         return response;
     }
@@ -447,7 +447,7 @@
     {
         error(
             "Failed to encode request firmware date response for endpoint ID '{EID}', response code '{RC}'",
-            "EID", unsigned(eid), "RC", rc);
+            "EID", eid, "RC", rc);
         return response;
     }
 
@@ -468,7 +468,7 @@
     {
         error(
             "Failed to decode TransferComplete request for endpoint ID '{EID}', response code '{RC}'",
-            "EID", unsigned(eid), "RC", rc);
+            "EID", eid, "RC", rc);
         rc = encode_transfer_complete_resp(request->hdr.instance_id,
                                            PLDM_ERROR_INVALID_DATA, responseMsg,
                                            sizeof(completionCode));
@@ -476,7 +476,7 @@
         {
             error(
                 "Failed to encode TransferComplete response for endpoint ID '{EID}', response code '{RC}'",
-                "EID", unsigned(eid), "RC", rc);
+                "EID", eid, "RC", rc);
         }
         return response;
     }
@@ -490,14 +490,14 @@
     {
         info(
             "Component endpoint ID '{EID}' and version '{COMPONENT_VERSION}' transfer complete.",
-            "EID", unsigned(eid), "COMPONENT_VERSION", compVersion);
+            "EID", eid, "COMPONENT_VERSION", compVersion);
     }
     else
     {
         error(
             "Failure in transfer of the component endpoint ID '{EID}' and version '{COMPONENT_VERSION}' with transfer result - {RESULT}",
-            "EID", unsigned(eid), "COMPONENT_VERSION", compVersion, "RESULT",
-            unsigned(transferResult));
+            "EID", eid, "COMPONENT_VERSION", compVersion, "RESULT",
+            transferResult);
     }
 
     rc = encode_transfer_complete_resp(request->hdr.instance_id, completionCode,
@@ -506,7 +506,7 @@
     {
         error(
             "Failed to encode transfer complete response of endpoint ID '{EID}', response code '{RC}'",
-            "EID", unsigned(eid), "RC", rc);
+            "EID", eid, "RC", rc);
         return response;
     }
 
@@ -526,7 +526,7 @@
     {
         error(
             "Failed to decode verify complete request of endpoint ID '{EID}', response code '{RC}'",
-            "EID", unsigned(eid), "RC", rc);
+            "EID", eid, "RC", rc);
         rc = encode_verify_complete_resp(request->hdr.instance_id,
                                          PLDM_ERROR_INVALID_DATA, responseMsg,
                                          sizeof(completionCode));
@@ -534,7 +534,7 @@
         {
             error(
                 "Failed to encode verify complete response of endpoint ID '{EID}', response code '{RC}'.",
-                "EID", unsigned(eid), "RC", rc);
+                "EID", eid, "RC", rc);
         }
         return response;
     }
@@ -548,14 +548,14 @@
     {
         info(
             "Component endpoint ID '{EID}' and version '{COMPONENT_VERSION}' verification complete.",
-            "EID", unsigned(eid), "COMPONENT_VERSION", compVersion);
+            "EID", eid, "COMPONENT_VERSION", compVersion);
     }
     else
     {
         error(
             "Failed to verify component endpoint ID '{EID}' and version '{COMPONENT_VERSION}' with transfer result - '{RESULT}'",
-            "EID", unsigned(eid), "COMPONENT_VERSION", compVersion, "RESULT",
-            unsigned(verifyResult));
+            "EID", eid, "COMPONENT_VERSION", compVersion, "RESULT",
+            verifyResult);
     }
 
     rc = encode_verify_complete_resp(request->hdr.instance_id, completionCode,
@@ -564,7 +564,7 @@
     {
         error(
             "Failed to encode verify complete response for endpoint ID '{EID}', response code - {RC}",
-            "EID", unsigned(eid), "RC", rc);
+            "EID", eid, "RC", rc);
         return response;
     }
 
@@ -586,7 +586,7 @@
     {
         error(
             "Failed to decode apply complete request for endpoint ID '{EID}', response code '{RC}'",
-            "EID", unsigned(eid), "RC", rc);
+            "EID", eid, "RC", rc);
         rc = encode_apply_complete_resp(request->hdr.instance_id,
                                         PLDM_ERROR_INVALID_DATA, responseMsg,
                                         sizeof(completionCode));
@@ -594,7 +594,7 @@
         {
             error(
                 "Failed to encode apply complete response for endpoint ID '{EID}', response code '{RC}'",
-                "EID", unsigned(eid), "RC", rc);
+                "EID", eid, "RC", rc);
         }
         return response;
     }
@@ -609,15 +609,14 @@
     {
         info(
             "Component endpoint ID '{EID}' with '{COMPONENT_VERSION}' apply complete.",
-            "EID", unsigned(eid), "COMPONENT_VERSION", compVersion);
+            "EID", eid, "COMPONENT_VERSION", compVersion);
         updateManager->updateActivationProgress();
     }
     else
     {
         error(
             "Failed to apply component endpoint ID '{EID}' and version '{COMPONENT_VERSION}', error - {ERROR}",
-            "EID", unsigned(eid), "COMPONENT_VERSION", compVersion, "ERROR",
-            unsigned(applyResult));
+            "EID", eid, "COMPONENT_VERSION", compVersion, "ERROR", applyResult);
     }
 
     rc = encode_apply_complete_resp(request->hdr.instance_id, completionCode,
@@ -626,7 +625,7 @@
     {
         error(
             "Failed to encode apply complete response for endpoint ID '{EID}', response code '{RC}'",
-            "EID", unsigned(eid), "RC", rc);
+            "EID", eid, "RC", rc);
         return response;
     }
 
@@ -665,7 +664,7 @@
         updateManager->instanceIdDb.free(eid, instanceId);
         error(
             "Failed to encode activate firmware req for endpoint ID '{EID}', response code '{RC}'",
-            "EID", unsigned(eid), "RC", rc);
+            "EID", eid, "RC", rc);
     }
 
     rc = updateManager->handler.registerRequest(
@@ -675,7 +674,7 @@
     {
         error(
             "Failed to send activate firmware request for endpoint ID '{EID}', response code '{RC}'",
-            "EID", unsigned(eid), "RC", rc);
+            "EID", eid, "RC", rc);
     }
 }
 
diff --git a/fw-update/inventory_manager.cpp b/fw-update/inventory_manager.cpp
index b8f86ea..f341f28 100644
--- a/fw-update/inventory_manager.cpp
+++ b/fw-update/inventory_manager.cpp
@@ -30,7 +30,7 @@
             instanceIdDb.free(eid, instanceId);
             error(
                 "Failed to encode query device identifiers req for endpoint ID '{EID}', response code '{RC}'",
-                "EID", unsigned(eid), "RC", rc);
+                "EID", eid, "RC", rc);
             continue;
         }
 
@@ -43,7 +43,7 @@
         {
             error(
                 "Failed to send query device identifiers request for endpoint ID '{EID}', response code '{RC}'",
-                "EID", unsigned(eid), "RC", rc);
+                "EID", eid, "RC", rc);
         }
     }
 }
@@ -56,7 +56,7 @@
     {
         error(
             "No response received for query device identifiers for endpoint ID '{EID}'",
-            "EID", unsigned(eid));
+            "EID", eid);
         return;
     }
 
@@ -72,8 +72,7 @@
     {
         error(
             "Failed to decode query device identifiers response for endpoint ID '{EID}' and descriptor count '{DESCRIPTOR_COUNT}', response code '{RC}'",
-            "EID", unsigned(eid), "DESCRIPTOR_COUNT", descriptorCount, "RC",
-            rc);
+            "EID", eid, "DESCRIPTOR_COUNT", descriptorCount, "RC", rc);
         return;
     }
 
@@ -81,7 +80,7 @@
     {
         error(
             "Failed to query device identifiers response for endpoint ID '{EID}', completion code '{CC}'",
-            "EID", unsigned(eid), "CC", unsigned(completionCode));
+            "EID", eid, "CC", completionCode);
         return;
     }
 
@@ -99,7 +98,7 @@
             error(
                 "Failed to decode descriptor type {TYPE}, length {LENGTH} and value for endpoint ID '{EID}', response code '{RC}'",
                 "TYPE", descriptorType, "LENGTH", deviceIdentifiersLen, "EID",
-                unsigned(eid), "RC", rc);
+                eid, "RC", rc);
             return;
         }
 
@@ -123,7 +122,7 @@
             {
                 error(
                     "Failed to decode vendor-defined descriptor value for endpoint ID '{EID}', response code '{RC}'",
-                    "EID", unsigned(eid), "RC", rc);
+                    "EID", eid, "RC", rc);
                 return;
             }
 
@@ -164,7 +163,7 @@
         instanceIdDb.free(eid, instanceId);
         error(
             "Failed to encode get firmware parameters req for endpoint ID '{EID}', response code '{RC}'",
-            "EID", unsigned(eid), "RC", rc);
+            "EID", eid, "RC", rc);
         return;
     }
 
@@ -177,7 +176,7 @@
     {
         error(
             "Failed to send get firmware parameters request for endpoint ID '{EID}', response code '{RC}'",
-            "EID", unsigned(eid), "RC", rc);
+            "EID", eid, "RC", rc);
     }
 }
 
@@ -189,7 +188,7 @@
     {
         error(
             "No response received for get firmware parameters for endpoint ID '{EID}'",
-            "EID", unsigned(eid));
+            "EID", eid);
         descriptorMap.erase(eid);
         return;
     }
@@ -206,15 +205,16 @@
     {
         error(
             "Failed to decode get firmware parameters response for endpoint ID '{EID}', response code '{RC}'",
-            "EID", unsigned(eid), "RC", rc);
+            "EID", eid, "RC", rc);
         return;
     }
 
     if (fwParams.completion_code)
     {
+        auto fw_param_cc = fwParams.completion_code;
         error(
             "Failed to get firmware parameters response for endpoint ID '{EID}', completion code '{CC}'",
-            "EID", unsigned(eid), "CC", unsigned(fwParams.completion_code));
+            "EID", eid, "CC", fw_param_cc);
         return;
     }
 
@@ -234,7 +234,7 @@
         {
             error(
                 "Failed to decode component parameter table entry for endpoint ID '{EID}', response code '{RC}'",
-                "EID", unsigned(eid), "RC", rc);
+                "EID", eid, "RC", rc);
             return;
         }
 
diff --git a/fw-update/update_manager.cpp b/fw-update/update_manager.cpp
index 428613b..2567996 100644
--- a/fw-update/update_manager.cpp
+++ b/fw-update/update_manager.cpp
@@ -57,7 +57,7 @@
     {
         error(
             "Failed to open the PLDM fw update package file '{FILE}', error - {ERROR}.",
-            "ERROR", unsigned(errno), "FILE", packageFilePath.c_str());
+            "ERROR", errno, "FILE", packageFilePath);
         package.close();
         std::filesystem::remove(packageFilePath);
         return -1;
diff --git a/host-bmc/dbus_to_event_handler.cpp b/host-bmc/dbus_to_event_handler.cpp
index 85740cf..b6a4ce1 100644
--- a/host-bmc/dbus_to_event_handler.cpp
+++ b/host-bmc/dbus_to_event_handler.cpp
@@ -61,7 +61,7 @@
         if (rc || completionCode)
         {
             error(
-                "Failed to decode response of platform_event message, response code '{RC}' and completion code '{CC}'",
+                "Failed to decode response of platform event message, response code '{RC}' and completion code '{CC}'",
                 "RC", rc, "CC", completionCode);
         }
     };
diff --git a/host-bmc/host_pdr_handler.cpp b/host-bmc/host_pdr_handler.cpp
index 352a2e4..2f65dd6 100644
--- a/host-bmc/host_pdr_handler.cpp
+++ b/host-bmc/host_pdr_handler.cpp
@@ -726,7 +726,7 @@
             return;
         }
         info("Getting the response code '{RC}'", "RC", lg2::hex,
-             static_cast<uint16_t>(response->payload[0]));
+             response->payload[0]);
         this->responseReceived = true;
         getHostPDR();
     };
diff --git a/libpldmresponder/bios_config.cpp b/libpldmresponder/bios_config.cpp
index 699e0d5..1d4733d 100644
--- a/libpldmresponder/bios_config.cpp
+++ b/libpldmresponder/bios_config.cpp
@@ -93,7 +93,7 @@
     if (!fs::exists(dir))
     {
         error("System specific bios attribute directory {DIR} does not exit",
-              "DIR", dir.string());
+              "DIR", dir);
         return;
     }
     constructAttributes();
@@ -690,14 +690,14 @@
                 {
                     error(
                         "Failed to parse JSON config file at path '{PATH}', error - {ERROR}",
-                        "PATH", filePath.c_str(), "ERROR", e);
+                        "PATH", filePath, "ERROR", e);
                 }
             }
         }
         catch (const std::exception& e)
         {
             error("Failed to parse JSON config file '{PATH}', error - {ERROR}",
-                  "PATH", filePath.c_str(), "ERROR", e);
+                  "PATH", filePath, "ERROR", e);
         }
     }
 }
@@ -836,7 +836,7 @@
             {
                 error(
                     "Invalid index '{INDEX}' encountered for Enum type BIOS attribute",
-                    "INDEX", (int)value[0]);
+                    "INDEX", value[0]);
                 return PLDM_ERROR_INVALID_DATA;
             }
             return PLDM_SUCCESS;
@@ -1034,7 +1034,7 @@
     {
         error(
             "Failed to update the attribute value table for attribute handle '{ATTR_HANDLE}' and  attribute type '{TYPE}'",
-            "ATTR_HANDLE", attrHdl, "TYPE", (uint32_t)attrType);
+            "ATTR_HANDLE", attrHdl, "TYPE", attrType);
         return;
     }
     auto destTable = table::attribute_value::updateTable(
diff --git a/libpldmresponder/event_parser.cpp b/libpldmresponder/event_parser.cpp
index b006d56..5158eda 100644
--- a/libpldmresponder/event_parser.cpp
+++ b/libpldmresponder/event_parser.cpp
@@ -28,7 +28,7 @@
     if (!fs::exists(dir) || fs::is_empty(dir))
     {
         error("Event config directory at '{PATH}' does not exist or empty",
-              "PATH", dirPath.c_str());
+              "PATH", dirPath);
         return;
     }
 
@@ -40,7 +40,7 @@
         if (data.is_discarded())
         {
             error("Failed to parse event state sensor JSON file at '{PATH}'",
-                  "PATH", file.path().c_str());
+                  "PATH", file.path());
             continue;
         }
 
@@ -76,7 +76,7 @@
             {
                 error(
                     "Invalid dbus config at '{PATH}', interface '{DBUS_INTERFACE}', property name '{PROPERTY_NAME}' and property type '{PROPERTY_TYPE}'",
-                    "PATH", dbusInfo.objectPath.c_str(), "DBUS_INTERFACE",
+                    "PATH", dbusInfo.objectPath, "DBUS_INTERFACE",
                     dbusInfo.interface, "PROPERTY_NAME", dbusInfo.propertyName,
                     "PROPERTY_TYPE", dbusInfo.propertyType);
                 continue;
diff --git a/libpldmresponder/fru_parser.cpp b/libpldmresponder/fru_parser.cpp
index 364a26b..c5ea3ea 100644
--- a/libpldmresponder/fru_parser.cpp
+++ b/libpldmresponder/fru_parser.cpp
@@ -49,7 +49,7 @@
     if (data.is_discarded())
     {
         error("Failed to parse FRU Dbus Lookup Map config file '{PATH}'",
-              "PATH", masterJsonPath.c_str());
+              "PATH", masterJsonPath);
         std::abort();
     }
     std::map<Interface, EntityType> defIntfToEntityType;
@@ -118,7 +118,7 @@
         if (data.is_discarded())
         {
             error("Failed to parse FRU config file at '{PATH}'", "PATH",
-                  file.path().c_str());
+                  file.path());
             throw InternalFailure();
         }
 
diff --git a/libpldmresponder/pdr_state_effecter.hpp b/libpldmresponder/pdr_state_effecter.hpp
index 4e3031a..42af4ad 100644
--- a/libpldmresponder/pdr_state_effecter.hpp
+++ b/libpldmresponder/pdr_state_effecter.hpp
@@ -44,8 +44,7 @@
             {
                 error(
                     "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));
+                    "STATE_EFFECTER_PDR", PLDM_STATE_EFFECTER_PDR);
                 throw InternalFailure();
             }
             pdrSize += sizeof(state_effecter_possible_states) -
diff --git a/libpldmresponder/pdr_state_sensor.hpp b/libpldmresponder/pdr_state_sensor.hpp
index dd9a992..58236da 100644
--- a/libpldmresponder/pdr_state_sensor.hpp
+++ b/libpldmresponder/pdr_state_sensor.hpp
@@ -43,8 +43,7 @@
             {
                 error(
                     "Malformed PDR JSON return pdrEntry; no state set info for state sensor pdr '{STATE_SENSOR_PDR}'",
-                    "STATE_SENSOR_PDR",
-                    static_cast<int>(PLDM_STATE_SENSOR_PDR));
+                    "STATE_SENSOR_PDR", PLDM_STATE_SENSOR_PDR);
                 throw InternalFailure();
             }
             pdrSize += sizeof(state_sensor_possible_states) -
diff --git a/libpldmresponder/platform.cpp b/libpldmresponder/platform.cpp
index 42bfc83..7d50b5d 100644
--- a/libpldmresponder/platform.cpp
+++ b/libpldmresponder/platform.cpp
@@ -951,8 +951,8 @@
         {
             error(
                 "The requester sent wrong composite effecter count '{COMPOSITE_EFFECTER_COUNT}' for the effecter ID '{EFFECTERID}'.",
-                "COMPOSITE_EFFECTER_COUNT", (uint16_t)compEffecterCnt,
-                "EFFECTERID", effecterId);
+                "COMPOSITE_EFFECTER_COUNT", compEffecterCnt, "EFFECTERID",
+                effecterId);
             return false;
         }
 
@@ -1013,7 +1013,7 @@
         {
             error(
                 "Failed to decode setEventReceiver command, response code '{RC}' and completion code '{CC}'",
-                "RC", rc, "CC", (unsigned)completionCode);
+                "RC", rc, "CC", completionCode);
             pldm::utils::reportError(
                 "xyz.openbmc_project.bmc.pldm.InternalFailure");
         }
diff --git a/libpldmresponder/platform.hpp b/libpldmresponder/platform.hpp
index ac07767..89eca61 100644
--- a/libpldmresponder/platform.hpp
+++ b/libpldmresponder/platform.hpp
@@ -362,8 +362,8 @@
             {
                 error(
                     "The requester sent wrong composite effecter count '{COMPOSITE_EFFECTER_COUNT}' for the effecter ID '{EFFECTERID}'.",
-                    "COMPOSITE_EFFECTER_COUNT", (unsigned)compEffecterCnt,
-                    "EFFECTERID", (unsigned)effecterId);
+                    "COMPOSITE_EFFECTER_COUNT", compEffecterCnt, "EFFECTERID",
+                    effecterId);
                 return PLDM_ERROR_INVALID_DATA;
             }
             break;
@@ -393,10 +393,10 @@
                 {
                     error(
                         "Invalid state set value for effecter ID '{EFFECTERID}', effecter state '{EFFECTER_STATE}', composite effecter ID '{COMPOSITE_EFFECTER_ID}' and path '{PATH}'.",
-                        "EFFECTERID", (unsigned)effecterId, "EFFECTER_STATE",
-                        (unsigned)stateField[currState].effecter_state,
-                        "COMPOSITE_EFFECTER_COUNT", (unsigned)currState, "PATH",
-                        dbusMappings[currState].objectPath.c_str());
+                        "EFFECTERID", effecterId, "EFFECTER_STATE",
+                        stateField[currState].effecter_state,
+                        "COMPOSITE_EFFECTER_COUNT", currState, "PATH",
+                        dbusMappings[currState].objectPath);
                     rc = PLDM_PLATFORM_SET_EFFECTER_UNSUPPORTED_SENSORSTATE;
                     break;
                 }
@@ -419,7 +419,7 @@
                             "Failed to set property '{PROPERTY}' of interface '{INTERFACE}' at path '{PATH}', error - {ERROR}",
                             "PROPERTY", dbusMapping.propertyName, "DBUS_INTF",
                             dbusMapping.interface, "DBUS_OBJ_PATH",
-                            dbusMapping.objectPath.c_str(), "ERROR", e);
+                            dbusMapping.objectPath, "ERROR", e);
                         return PLDM_ERROR;
                     }
                 }
@@ -436,7 +436,7 @@
         {
             error(
                 "The effecter ID '{EFFECTERID}' does not exist, error - {ERROR}.",
-                "EFFECTERID", (unsigned)effecterId, "ERROR", e);
+                "EFFECTERID", effecterId, "ERROR", e);
         }
 
         return rc;
diff --git a/libpldmresponder/platform_numeric_effecter.hpp b/libpldmresponder/platform_numeric_effecter.hpp
index 1cad4a4..274357c 100644
--- a/libpldmresponder/platform_numeric_effecter.hpp
+++ b/libpldmresponder/platform_numeric_effecter.hpp
@@ -324,8 +324,8 @@
             error(
                 "Failed to set property '{PROPERTY}', interface '{INTERFACE}' and path '{PATH}', error - {ERROR}",
                 "PROPERTY", dbusMapping.propertyName, "INTERFACE",
-                dbusMapping.interface, "PATH", dbusMapping.objectPath.c_str(),
-                "ERROR", e);
+                dbusMapping.interface, "PATH", dbusMapping.objectPath, "ERROR",
+                e);
             return PLDM_ERROR;
         }
     }
@@ -559,9 +559,8 @@
             "EFFECTERID", effecterId, "ERROR", e);
         error(
             "Dbus Details path [{PATH}], interface [{INTERFACE}] and  property [{PROPERTY}]",
-            "PATH", dbusMapping.objectPath.c_str(), "INTERFACE",
-            dbusMapping.interface.c_str(), "PROPERTY",
-            dbusMapping.propertyName.c_str());
+            "PATH", dbusMapping.objectPath, "INTERFACE", dbusMapping.interface,
+            "PROPERTY", dbusMapping.propertyName);
         return PLDM_ERROR;
     }
 
diff --git a/libpldmresponder/platform_state_effecter.hpp b/libpldmresponder/platform_state_effecter.hpp
index a23732b..201b283 100644
--- a/libpldmresponder/platform_state_effecter.hpp
+++ b/libpldmresponder/platform_state_effecter.hpp
@@ -125,7 +125,7 @@
                     "EFFECTER_ID", effecterId, "EFFECTER_STATE",
                     stateField[currState].effecter_state,
                     "COMPOSITE_EFFECTER_ID", currState, "PATH",
-                    dbusMappings[currState].objectPath.c_str(), "RC", rc);
+                    dbusMappings[currState].objectPath, "RC", rc);
                 break;
             }
             const DBusMapping& dbusMapping = dbusMappings[currState];
@@ -145,8 +145,8 @@
                     error(
                         "Failed to set property '{PROPERTY}', interface '{INTERFACE}' and path '{PATH}', error - '{ERROR}'",
                         "PROPERTY", dbusMapping.propertyName, "INTERFACE",
-                        dbusMapping.interface, "PATH",
-                        dbusMapping.objectPath.c_str(), "ERROR", e);
+                        dbusMapping.interface, "PATH", dbusMapping.objectPath,
+                        "ERROR", e);
                     return PLDM_ERROR;
                 }
             }
diff --git a/libpldmresponder/platform_state_sensor.hpp b/libpldmresponder/platform_state_sensor.hpp
index 960f89d..4fab000 100644
--- a/libpldmresponder/platform_state_sensor.hpp
+++ b/libpldmresponder/platform_state_sensor.hpp
@@ -55,7 +55,7 @@
     {
         error(
             "Failed to get state sensor event state from dbus interface '{PATH}', error - {ERROR}.",
-            "PATH", dbusMapping.objectPath.c_str(), "ERROR", e);
+            "PATH", dbusMapping.objectPath, "ERROR", e);
     }
 
     return PLDM_SENSOR_UNKNOWN;
diff --git a/oem/ibm/libpldmresponder/file_io.hpp b/oem/ibm/libpldmresponder/file_io.hpp
index e455583..495cf24 100644
--- a/oem/ibm/libpldmresponder/file_io.hpp
+++ b/oem/ibm/libpldmresponder/file_io.hpp
@@ -117,7 +117,7 @@
     int file = open(path.string().c_str(), flags);
     if (file == -1)
     {
-        error("File at path '{PATH}' does not exist", "PATH", path.string());
+        error("File at path '{PATH}' does not exist", "PATH", path);
         encode_rw_file_memory_resp(instanceId, command, PLDM_ERROR, 0,
                                    responsePtr);
         return response;
diff --git a/oem/ibm/libpldmresponder/file_io_type_pcie.cpp b/oem/ibm/libpldmresponder/file_io_type_pcie.cpp
index 92ceff9..b95361f 100644
--- a/oem/ibm/libpldmresponder/file_io_type_pcie.cpp
+++ b/oem/ibm/libpldmresponder/file_io_type_pcie.cpp
@@ -59,7 +59,7 @@
     catch (const std::exception& e)
     {
         error("Create/Write data to the File type {TYPE}, failed {ERROR}",
-              "TYPE", (int)infoType, "ERROR", e);
+              "TYPE", infoType, "ERROR", e);
         return PLDM_ERROR;
     }
 }
@@ -87,7 +87,7 @@
     catch (const std::exception& e)
     {
         error("Create/Write data to the File type {TYPE}, failed {ERROR}",
-              "TYPE", (int)infoType, "ERROR", e);
+              "TYPE", infoType, "ERROR", e);
         return PLDM_ERROR;
     }
 
diff --git a/oem/ibm/libpldmresponder/oem_ibm_handler.cpp b/oem/ibm/libpldmresponder/oem_ibm_handler.cpp
index 906e964..301de47 100644
--- a/oem/ibm/libpldmresponder/oem_ibm_handler.cpp
+++ b/oem/ibm/libpldmresponder/oem_ibm_handler.cpp
@@ -322,7 +322,7 @@
         {
             error(
                 "Failed to decode platform event message response for code update event with response code '{RC}' and completion code '{CC}'",
-                "RC", rc, "CC", static_cast<unsigned>(completionCode));
+                "RC", rc, "CC", completionCode);
         }
     };
     auto rc = handler->registerRequest(
diff --git a/oem/ibm/libpldmresponder/platform_oem_ibm.cpp b/oem/ibm/libpldmresponder/platform_oem_ibm.cpp
index 4ea7b2f..da9e4d3 100644
--- a/oem/ibm/libpldmresponder/platform_oem_ibm.cpp
+++ b/oem/ibm/libpldmresponder/platform_oem_ibm.cpp
@@ -98,7 +98,7 @@
         {
             error(
                 "Failed to decode BIOS Attribute update platform event message response with response code '{RC}' and completion code '{CC}'",
-                "RC", rc, "CC", static_cast<unsigned>(completionCode));
+                "RC", rc, "CC", completionCode);
         }
     };
     rc = handler->registerRequest(
diff --git a/oem/ibm/requester/dbus_to_file_handler.cpp b/oem/ibm/requester/dbus_to_file_handler.cpp
index 19b3e6b..b90690e 100644
--- a/oem/ibm/requester/dbus_to_file_handler.cpp
+++ b/oem/ibm/requester/dbus_to_file_handler.cpp
@@ -73,7 +73,7 @@
         {
             error(
                 "Failed to decode new file available response or remote terminus returned error, response code '{RC}' and completion code '{CC}'",
-                "RC", rc, "CC", static_cast<unsigned>(completionCode));
+                "RC", rc, "CC", completionCode);
             reportResourceDumpFailure();
         }
     };
@@ -279,7 +279,7 @@
         {
             error(
                 "Failed to decode new file available response for vmi or remote terminus returned error, response code '{RC}' and completion code '{CC}'",
-                "RC", rc, "CC", static_cast<unsigned>(completionCode));
+                "RC", rc, "CC", completionCode);
             pldm::utils::reportError(
                 "xyz.openbmc_project.bmc.pldm.InternalFailure");
         }
diff --git a/requester/handler.hpp b/requester/handler.hpp
index cefeb78..20da26c 100644
--- a/requester/handler.hpp
+++ b/requester/handler.hpp
@@ -148,8 +148,7 @@
         {
             info(
                 "Instance ID expiry for EID '{EID}' using InstanceID '{INSTANCEID}'",
-                "EID", (unsigned)key.eid, "INSTANCEID",
-                (unsigned)key.instanceId);
+                "EID", key.eid, "INSTANCEID", key.instanceId);
             auto& [request, responseHandler,
                    timerInstance] = this->handlers[key];
             request->stop();
@@ -158,7 +157,7 @@
             {
                 error(
                     "Failed to stop the instance ID expiry timer, response code '{RC}'",
-                    "RC", static_cast<int>(rc));
+                    "RC", rc);
             }
             // Call response handler with an empty response to indicate no
             // response
@@ -259,7 +258,7 @@
         {
             error(
                 "Register request for EID '{EID}' is using InstanceID '{INSTANCEID}'",
-                "EID", (unsigned)eid, "INSTANCEID", (unsigned)instanceId);
+                "EID", eid, "INSTANCEID", instanceId);
             return PLDM_ERROR;
         }
 
@@ -372,7 +371,7 @@
             {
                 error(
                     "Failed to stop the instance ID expiry timer, response code '{RC}'",
-                    "RC", static_cast<int>(rc));
+                    "RC", rc);
             }
             responseHandler(eid, response, respMsgLen);
             instanceIdDb.free(key.eid, key.instanceId);
diff --git a/requester/mctp_endpoint_discovery.cpp b/requester/mctp_endpoint_discovery.cpp
index 0d63ad4..2780281 100644
--- a/requester/mctp_endpoint_discovery.cpp
+++ b/requester/mctp_endpoint_discovery.cpp
@@ -79,7 +79,7 @@
                     {
                         info(
                             "Adding Endpoint networkId '{NETWORK}' and EID '{EID}'",
-                            "NETWORK", networkId, "EID", unsigned(eid));
+                            "NETWORK", networkId, "EID", eid);
                         mctpInfos.emplace_back(
                             MctpInfo(eid, emptyUUID, "", networkId));
                     }
@@ -135,7 +135,7 @@
                 {
                     info(
                         "Adding Endpoint networkId '{NETWORK}' and EID '{EID}'",
-                        "NETWORK", networkId, "EID", unsigned(eid));
+                        "NETWORK", networkId, "EID", eid);
                     mctpInfos.emplace_back(
                         MctpInfo(eid, emptyUUID, "", networkId));
                 }
@@ -170,8 +170,7 @@
     for (const auto& mctpInfo : removedInfos)
     {
         info("Removing Endpoint networkId '{NETWORK}' and  EID '{EID}'",
-             "NETWORK", std::get<3>(mctpInfo), "EID",
-             unsigned(std::get<0>(mctpInfo)));
+             "NETWORK", std::get<3>(mctpInfo), "EID", std::get<0>(mctpInfo));
         existingMctpInfos.erase(std::remove(existingMctpInfos.begin(),
                                             existingMctpInfos.end(), mctpInfo),
                                 existingMctpInfos.end());
diff --git a/requester/request.hpp b/requester/request.hpp
index ff17886..0ba6172 100644
--- a/requester/request.hpp
+++ b/requester/request.hpp
@@ -90,7 +90,7 @@
         if (rc)
         {
             error("Failed to stop the request timer, response code '{RC}'",
-                  "RC", static_cast<int>(rc));
+                  "RC", rc);
         }
     }
 
@@ -197,7 +197,7 @@
         {
             error(
                 "Failed to send pldmTransport message, response code '{RC}' and error - {ERROR}",
-                "RC", static_cast<int>(rc), "ERROR", errno);
+                "RC", rc, "ERROR", errno);
             return PLDM_ERROR;
         }
         return PLDM_SUCCESS;
diff --git a/softoff/softoff.cpp b/softoff/softoff.cpp
index c522635..d3c2284 100644
--- a/softoff/softoff.cpp
+++ b/softoff/softoff.cpp
@@ -70,7 +70,7 @@
             if (rc != PLDM_SUCCESS)
             {
                 error("Failed to get Sensor PDRs, response code '{RC}'", "RC",
-                      lg2::hex, static_cast<int>(rc));
+                      lg2::hex, rc);
                 hasError = true;
                 return;
             }
@@ -296,7 +296,7 @@
         instanceIdDb.free(pldmTID, instanceID);
         error(
             "Failed to encode set state effecter states request message, response code '{RC}'",
-            "RC", lg2::hex, static_cast<int>(rc));
+            "RC", lg2::hex, rc);
         return PLDM_ERROR;
     }
 
@@ -337,7 +337,7 @@
         {
             error(
                 "Failed to receive pldm data during soft-off, response code '{RC}'",
-                "RC", static_cast<int>(rc));
+                "RC", rc);
             return;
         }
 
@@ -363,7 +363,7 @@
         if (response->payload[0] != PLDM_SUCCESS)
         {
             error("Getting the wrong response, response code '{RC}'", "RC",
-                  (unsigned)response->payload[0]);
+                  response->payload[0]);
             exit(-1);
         }
 
@@ -399,7 +399,7 @@
         instanceIdDb.free(pldmTID, instanceID);
         error(
             "Failed to send message/receive response, response code '{RC}' and error - {ERROR}",
-            "RC", static_cast<int>(rc), "ERROR", errno);
+            "RC", rc, "ERROR", errno);
         return PLDM_ERROR;
     }
 
diff --git a/utilities/requester/set_state_effecter.cpp b/utilities/requester/set_state_effecter.cpp
index 19ffd7a..3287c4b 100644
--- a/utilities/requester/set_state_effecter.cpp
+++ b/utilities/requester/set_state_effecter.cpp
@@ -56,7 +56,7 @@
     pldm_msg* response = reinterpret_cast<pldm_msg*>(responseMsg);
     info(
         "Done! Got the response for PLDM send receive message request, response code '{RC}'",
-        "RC", lg2::hex, static_cast<uint16_t>(response->payload[0]));
+        "RC", lg2::hex, response->payload[0]);
     free(responseMsg);
 
     return 0;
diff --git a/utilities/requester/set_state_effecter_async.cpp b/utilities/requester/set_state_effecter_async.cpp
index 0116deb..f11f5e4 100644
--- a/utilities/requester/set_state_effecter_async.cpp
+++ b/utilities/requester/set_state_effecter_async.cpp
@@ -77,7 +77,7 @@
         io.set_enabled(Enabled::Off);
         info(
             "Done! Got the response for PLDM request message, response code '{RC}'",
-            "RC", lg2::hex, static_cast<uint16_t>(response->payload[0]));
+            "RC", lg2::hex, response->payload[0]);
         free(responseMsg);
         exit(EXIT_SUCCESS);
     };