regulators: Create error log entries
Create error log entries when the following regulator operations fail:
* configuration
* presence detection
* sensor monitoring
* closing I2C devices
Use the recently created error_logging_utils namespace to create error
logs based on caught exceptions.
Signed-off-by: Shawn McCarney <shawnmm@us.ibm.com>
Change-Id: I25824ecfdaa270abbce92b52bdea0602271d926d
diff --git a/phosphor-regulators/src/device.cpp b/phosphor-regulators/src/device.cpp
index 8ae7afb..08c5174 100644
--- a/phosphor-regulators/src/device.cpp
+++ b/phosphor-regulators/src/device.cpp
@@ -17,6 +17,7 @@
#include "device.hpp"
#include "chassis.hpp"
+#include "error_logging_utils.hpp"
#include "exception_utils.hpp"
#include "system.hpp"
@@ -63,7 +64,9 @@
services.getJournal().logError(exception_utils::getMessages(e));
services.getJournal().logError("Unable to close device " + id);
- // TODO: Create error log entry
+ // Create error log entry
+ error_logging_utils::logError(std::current_exception(),
+ Entry::Level::Notice, services);
}
}