Logger changes for VPD collection and write logs

This commit includes changes in Logger class for handling VPD collection
and VPD write logs. VPD collection and VPD write logs need to be handled
by different LogFileHandler instances. This commit also adds public
methods to initiate and terminate VPD collection logging. These methods
are required to control start and stop of VPD collection logs.

Change-Id: Idcc2da3d600819c8e88543a5d45161b9642634ad
Signed-off-by: Souvik Roy <souvikroyofficial10@gmail.com>
diff --git a/vpd-manager/oem-handler/ibm_handler.cpp b/vpd-manager/oem-handler/ibm_handler.cpp
index 436c617..df25af9 100644
--- a/vpd-manager/oem-handler/ibm_handler.cpp
+++ b/vpd-manager/oem-handler/ibm_handler.cpp
@@ -21,7 +21,8 @@
     const std::shared_ptr<sdbusplus::asio::connection>& i_asioConnection) :
     m_worker(o_worker), m_backupAndRestoreObj(o_backupAndRestoreObj),
     m_interface(i_iFace), m_progressInterface(i_progressiFace),
-    m_ioContext(i_ioCon), m_asioConnection(i_asioConnection)
+    m_ioContext(i_ioCon), m_asioConnection(i_asioConnection),
+    m_logger(Logger::getLoggerInstance())
 {
     if (dbusUtility::isChassisPowerOn())
     {
@@ -127,6 +128,9 @@
             {
                 m_eventListener->registerCorrPropCallBack();
             }
+
+            // terminate collection logger
+            m_logger->terminateVpdCollectionLogging();
         }
         else
         {
@@ -136,6 +140,9 @@
                 l_timer.cancel();
                 logging::logMessage("Taking too long. Active thread = " +
                                     std::to_string(l_threadCount));
+
+                // terminate collection logger
+                m_logger->terminateVpdCollectionLogging();
             }
             else
             {
@@ -500,6 +507,9 @@
 
 void IbmHandler::collectAllFruVpd()
 {
+    // initialize VPD collection logger
+    m_logger->initiateVpdCollectionLogging();
+
     // Setting status to "InProgress", before trigeering VPD collection.
     m_progressInterface->set_property(
         "Status", std::string(constants::vpdCollectionInProgress));