Log PEL when registering property change fails
This commit adds the code to create a PEL when registering for property
change signal for the Asset tag and Host state fails, instead of just
logging the failure.
Change-Id: Ie7a7adb236d141fd3ab1710deaf9a7db0c8fc783
Signed-off-by: Anupama B R <anupama.b.r1@ibm.com>
diff --git a/vpd-manager/src/listener.cpp b/vpd-manager/src/listener.cpp
index 624f743..5c54467 100644
--- a/vpd-manager/src/listener.cpp
+++ b/vpd-manager/src/listener.cpp
@@ -30,9 +30,12 @@
}
catch (const std::exception& l_ex)
{
- logging::logMessage(
+ EventLogger::createSyncPel(
+ EventLogger::getErrorType(l_ex), types::SeverityType::Informational,
+ __FILE__, __FUNCTION__, 0,
"Register Host state change callback failed, reason: " +
- std::string(l_ex.what()));
+ std::string(l_ex.what()),
+ std::nullopt, std::nullopt, std::nullopt, std::nullopt);
}
}
@@ -111,9 +114,12 @@
}
catch (const std::exception& l_ex)
{
- logging::logMessage(
+ EventLogger::createSyncPel(
+ EventLogger::getErrorType(l_ex), types::SeverityType::Informational,
+ __FILE__, __FUNCTION__, 0,
"Register AssetTag change callback failed, reason: " +
- std::string(l_ex.what()));
+ std::string(l_ex.what()),
+ std::nullopt, std::nullopt, std::nullopt, std::nullopt);
}
}