|
3 | 3 | #include "bios_handler.hpp"
|
4 | 4 |
|
5 | 5 | #include "constants.hpp"
|
| 6 | +#include "event_logger.hpp" |
6 | 7 | #include "logger.hpp"
|
7 | 8 |
|
8 | 9 | #include <sdbusplus/bus/match.hpp>
|
@@ -145,8 +146,11 @@ void IbmBiosHandler::biosAttributesCallback(sdbusplus::message_t& i_msg)
|
145 | 146 | }
|
146 | 147 | else
|
147 | 148 | {
|
148 |
| - // TODO: log a predicitive PEL. |
149 |
| - logging::logMessage("Invalid typre received from BIOS table."); |
| 149 | + EventLogger::createSyncPel( |
| 150 | + types::ErrorType::InvalidVpdMessage, |
| 151 | + types::SeverityType::Warning, __FILE__, __FUNCTION__, 0, |
| 152 | + "Invalid type received from BIOS table.", std::nullopt, |
| 153 | + std::nullopt, std::nullopt, std::nullopt); |
150 | 154 | break;
|
151 | 155 | }
|
152 | 156 | }
|
@@ -299,10 +303,12 @@ void IbmBiosHandler::saveFcoToBios(const types::BinaryVector& i_fcoVal)
|
299 | 303 | }
|
300 | 304 | catch (const std::exception& l_ex)
|
301 | 305 | {
|
302 |
| - // TODO: Should we log informational PEL here as well? |
303 |
| - logging::logMessage( |
| 306 | + EventLogger::createSyncPel( |
| 307 | + types::ErrorType::DbusFailure, types::SeverityType::Informational, |
| 308 | + __FILE__, __FUNCTION__, 0, |
304 | 309 | "DBus call to update FCO value in pending attribute failed. " +
|
305 |
| - std::string(l_ex.what())); |
| 310 | + std::string(l_ex.what()), |
| 311 | + std::nullopt, std::nullopt, std::nullopt, std::nullopt); |
306 | 312 | }
|
307 | 313 | }
|
308 | 314 |
|
@@ -346,9 +352,11 @@ void IbmBiosHandler::saveAmmToVpd(const std::string& i_memoryMirrorMode)
|
346 | 352 | }
|
347 | 353 | else
|
348 | 354 | {
|
349 |
| - // TODO: Add PEL |
350 |
| - logging::logMessage( |
351 |
| - "Invalid type read for memory mirror mode value from DBus. Skip writing to VPD"); |
| 355 | + EventLogger::createSyncPel( |
| 356 | + types::ErrorType::InvalidVpdMessage, |
| 357 | + types::SeverityType::Informational, __FILE__, __FUNCTION__, 0, |
| 358 | + "Invalid type read for memory mirror mode value from DBus. Skip writing to VPD", |
| 359 | + std::nullopt, std::nullopt, std::nullopt, std::nullopt); |
352 | 360 | }
|
353 | 361 | }
|
354 | 362 |
|
@@ -379,10 +387,12 @@ void IbmBiosHandler::saveAmmToBios(const std::string& i_ammVal)
|
379 | 387 | }
|
380 | 388 | catch (const std::exception& l_ex)
|
381 | 389 | {
|
382 |
| - // TODO: Should we log informational PEL here as well? |
383 |
| - logging::logMessage( |
| 390 | + EventLogger::createSyncPel( |
| 391 | + types::ErrorType::DbusFailure, types::SeverityType::Informational, |
| 392 | + __FILE__, __FUNCTION__, 0, |
384 | 393 | "DBus call to update AMM value in pending attribute failed. " +
|
385 |
| - std::string(l_ex.what())); |
| 394 | + std::string(l_ex.what()), |
| 395 | + std::nullopt, std::nullopt, std::nullopt, std::nullopt); |
386 | 396 | }
|
387 | 397 | }
|
388 | 398 |
|
@@ -514,9 +524,12 @@ void IbmBiosHandler::saveCreateDefaultLparToBios(
|
514 | 524 | }
|
515 | 525 | catch (const std::exception& l_ex)
|
516 | 526 | {
|
517 |
| - logging::logMessage( |
| 527 | + EventLogger::createSyncPel( |
| 528 | + types::ErrorType::DbusFailure, types::SeverityType::Informational, |
| 529 | + __FILE__, __FUNCTION__, 0, |
518 | 530 | "DBus call to update lpar value in pending attribute failed. " +
|
519 |
| - std::string(l_ex.what())); |
| 531 | + std::string(l_ex.what()), |
| 532 | + std::nullopt, std::nullopt, std::nullopt, std::nullopt); |
520 | 533 | }
|
521 | 534 |
|
522 | 535 | return;
|
@@ -630,9 +643,12 @@ void IbmBiosHandler::saveClearNvramToBios(const std::string& i_clearNvramVal)
|
630 | 643 | }
|
631 | 644 | catch (const std::exception& l_ex)
|
632 | 645 | {
|
633 |
| - logging::logMessage( |
| 646 | + EventLogger::createSyncPel( |
| 647 | + types::ErrorType::DbusFailure, types::SeverityType::Informational, |
| 648 | + __FILE__, __FUNCTION__, 0, |
634 | 649 | "DBus call to update NVRAM value in pending attribute failed. " +
|
635 |
| - std::string(l_ex.what())); |
| 650 | + std::string(l_ex.what()), |
| 651 | + std::nullopt, std::nullopt, std::nullopt, std::nullopt); |
636 | 652 | }
|
637 | 653 | }
|
638 | 654 |
|
@@ -741,9 +757,12 @@ void IbmBiosHandler::saveKeepAndClearToBios(
|
741 | 757 | }
|
742 | 758 | catch (const std::exception& l_ex)
|
743 | 759 | {
|
744 |
| - logging::logMessage( |
| 760 | + EventLogger::createSyncPel( |
| 761 | + types::ErrorType::DbusFailure, types::SeverityType::Informational, |
| 762 | + __FILE__, __FUNCTION__, 0, |
745 | 763 | "DBus call to update keep and clear value in pending attribute failed. " +
|
746 |
| - std::string(l_ex.what())); |
| 764 | + std::string(l_ex.what()), |
| 765 | + std::nullopt, std::nullopt, std::nullopt, std::nullopt); |
747 | 766 | }
|
748 | 767 | }
|
749 | 768 |
|
|
0 commit comments