diff --git a/vpd-manager/src/bios_handler.cpp b/vpd-manager/src/bios_handler.cpp index 3cb2f327..90e63227 100644 --- a/vpd-manager/src/bios_handler.cpp +++ b/vpd-manager/src/bios_handler.cpp @@ -3,6 +3,7 @@ #include "bios_handler.hpp" #include "constants.hpp" +#include "event_logger.hpp" #include "logger.hpp" #include @@ -145,7 +146,12 @@ void IbmBiosHandler::biosAttributesCallback(sdbusplus::message_t& i_msg) } else { - // TODO: log a predicitive PEL. + EventLogger::createSyncPel( + types::ErrorType::DbusFailure, types::SeverityType::Warning, + __FILE__, __FUNCTION__, 0, + "Invalid typre received from BIOS table.", std::nullopt, + std::nullopt, std::nullopt, std::nullopt); + logging::logMessage("Invalid typre received from BIOS table."); break; } @@ -299,10 +305,12 @@ void IbmBiosHandler::saveFcoToBios(const types::BinaryVector& i_fcoVal) } catch (const std::exception& l_ex) { - // TODO: Should we log informational PEL here as well? - logging::logMessage( + EventLogger::createSyncPel( + types::ErrorType::DbusFailure, types::SeverityType::Informational, + __FILE__, __FUNCTION__, 0, "DBus call to update FCO value in pending attribute failed. " + - std::string(l_ex.what())); + std::string(l_ex.what()), + std::nullopt, std::nullopt, std::nullopt, std::nullopt); } } @@ -346,7 +354,6 @@ void IbmBiosHandler::saveAmmToVpd(const std::string& i_memoryMirrorMode) } else { - // TODO: Add PEL logging::logMessage( "Invalid type read for memory mirror mode value from DBus. Skip writing to VPD"); } @@ -379,10 +386,12 @@ void IbmBiosHandler::saveAmmToBios(const std::string& i_ammVal) } catch (const std::exception& l_ex) { - // TODO: Should we log informational PEL here as well? - logging::logMessage( + EventLogger::createSyncPel( + types::ErrorType::DbusFailure, types::SeverityType::Informational, + __FILE__, __FUNCTION__, 0, "DBus call to update AMM value in pending attribute failed. " + - std::string(l_ex.what())); + std::string(l_ex.what()), + std::nullopt, std::nullopt, std::nullopt, std::nullopt); } } @@ -514,9 +523,12 @@ void IbmBiosHandler::saveCreateDefaultLparToBios( } catch (const std::exception& l_ex) { - logging::logMessage( + EventLogger::createSyncPel( + types::ErrorType::DbusFailure, types::SeverityType::Informational, + __FILE__, __FUNCTION__, 0, "DBus call to update lpar value in pending attribute failed. " + - std::string(l_ex.what())); + std::string(l_ex.what()), + std::nullopt, std::nullopt, std::nullopt, std::nullopt); } return; @@ -630,9 +642,12 @@ void IbmBiosHandler::saveClearNvramToBios(const std::string& i_clearNvramVal) } catch (const std::exception& l_ex) { - logging::logMessage( + EventLogger::createSyncPel( + types::ErrorType::DbusFailure, types::SeverityType::Informational, + __FILE__, __FUNCTION__, 0, "DBus call to update NVRAM value in pending attribute failed. " + - std::string(l_ex.what())); + std::string(l_ex.what()), + std::nullopt, std::nullopt, std::nullopt, std::nullopt); } } @@ -741,9 +756,12 @@ void IbmBiosHandler::saveKeepAndClearToBios( } catch (const std::exception& l_ex) { - logging::logMessage( + EventLogger::createSyncPel( + types::ErrorType::DbusFailure, types::SeverityType::Informational, + __FILE__, __FUNCTION__, 0, "DBus call to update keep and clear value in pending attribute failed. " + - std::string(l_ex.what())); + std::string(l_ex.what()), + std::nullopt, std::nullopt, std::nullopt, std::nullopt); } }