Update logs and doxygen for vpd-tool
This commit updates the following for vpd-tool,
* Removed duplicate success log for write keyword command.
* Updated the doxygen for readKeyword API.
* Error logs are enabled in all places until verbose mode is
implemented.
Change-Id: Ica201694fc87445d4cd368875d1414140c77b236
Signed-off-by: Anupama B R <anupama.b.r1@ibm.com>
diff --git a/vpd-tool/include/tool_utils.hpp b/vpd-tool/include/tool_utils.hpp
index fece0ec..e4b0a33 100644
--- a/vpd-tool/include/tool_utils.hpp
+++ b/vpd-tool/include/tool_utils.hpp
@@ -376,10 +376,6 @@
l_result.read(l_rc);
- if (l_rc > 0)
- {
- std::cout << "Data updated successfully " << std::endl;
- }
return l_rc;
}
@@ -540,7 +536,7 @@
catch (const sdbusplus::exception::SdBusError& l_ex)
{
// TODO: log only when verbose is enabled
- // std::cerr << std::string(l_ex.what()) << std::endl;
+ std::cerr << std::string(l_ex.what()) << std::endl;
}
return l_serviceInfMap;
}
diff --git a/vpd-tool/src/vpd_tool.cpp b/vpd-tool/src/vpd_tool.cpp
index e197ee6..ce10e6c 100644
--- a/vpd-tool/src/vpd_tool.cpp
+++ b/vpd-tool/src/vpd_tool.cpp
@@ -73,17 +73,16 @@
else
{
// TODO: Enable logging when verbose is enabled.
- // std::cout << "Invalid data type or empty data received." <<
- // std::endl;
+ std::cout << "Invalid data type or empty data received."
+ << std::endl;
}
}
catch (const std::exception& l_ex)
{
// TODO: Enable logging when verbose is enabled.
- /*std::cerr << "Read keyword's value for path: " << i_vpdPath
- << ", Record: " << i_recordName
- << ", Keyword: " << i_keywordName
- << " is failed, exception: " << l_ex.what() << std::endl;*/
+ std::cerr << "Read keyword's value failed for path: " << i_vpdPath
+ << ", Record: " << i_recordName << ", Keyword: "
+ << i_keywordName << ", error: " << l_ex.what() << std::endl;
}
return l_rc;
}
@@ -249,15 +248,15 @@
else
{
// TODO: Enable logging when verbose is enabled.
- // std::cout << "Invalid data type received." << std::endl;
+ std::cout << "Invalid data type received." << std::endl;
}
}
catch (const std::exception& l_ex)
{
// TODO: Enable logging when verbose is enabled.
- /*std::cerr << "Read " << i_propertyName << " value for FRU path: " <<
- i_objectPath
- << ", failed with exception: " << l_ex.what() << std::endl;*/
+ std::cerr << "Read " << i_propertyName
+ << " value for FRU path: " << i_objectPath
+ << ", failed with exception: " << l_ex.what() << std::endl;
}
return l_resultInJson;
}
diff --git a/vpd-tool/src/vpd_tool_main.cpp b/vpd-tool/src/vpd_tool_main.cpp
index 06a6ca7..93fdd38 100644
--- a/vpd-tool/src/vpd_tool_main.cpp
+++ b/vpd-tool/src/vpd_tool_main.cpp
@@ -103,7 +103,7 @@
* @param[in] i_keywordName - Keyword to be updated.
* @param[in] i_filePath - File path to save keyword's read value.
*
- * @return Status of readKeyword operation, failure otherwise.
+ * @return On success return 0, otherwise return -1.
*/
int readKeyword(const auto& i_hardwareFlag, const std::string& i_vpdPath,
const std::string& i_recordName,