Revamped code for VPD parser
The commit removes all the pre-existing code from the branch
and pushes the revamped code.
Major modification includes:
- Movement from multi exe to single daemon model.
- Multithreaded approach to parse FRU VPD.
- Better error handling.
- Refactored code for performance optimization.
Note: This code supports all the existing functionalities as it is.
Change-Id: I1ddce1f0725ac59020b72709689a1013643bda8b
Signed-off-by: Sunny Srivastava <sunnsr25@in.ibm.com>
diff --git a/vpd-manager/src/logger.cpp b/vpd-manager/src/logger.cpp
new file mode 100644
index 0000000..19959a1
--- /dev/null
+++ b/vpd-manager/src/logger.cpp
@@ -0,0 +1,23 @@
+#include "logger.hpp"
+
+#include <sstream>
+
+namespace vpd
+{
+namespace logging
+{
+void logMessage(std::string_view message, const std::source_location& location)
+{
+ std::ostringstream log;
+ log << "FileName: " << location.file_name() << ","
+ << " Line: " << location.line() << " " << message;
+
+ /* TODO: Check on this later.
+ log << "FileName: " << location.file_name() << ","
+ << " Line: " << location.line() << ","
+ << " Func: " << location.function_name() << ", " << message;*/
+
+ std::cout << log.str() << std::endl;
+}
+} // namespace logging
+} // namespace vpd