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/sensor_monitoring.cpp b/phosphor-regulators/src/sensor_monitoring.cpp
index 1ce1eee..c46ff1a 100644
--- a/phosphor-regulators/src/sensor_monitoring.cpp
+++ b/phosphor-regulators/src/sensor_monitoring.cpp
@@ -20,6 +20,7 @@
 #include "action_utils.hpp"
 #include "chassis.hpp"
 #include "device.hpp"
+#include "error_logging_utils.hpp"
 #include "exception_utils.hpp"
 #include "rail.hpp"
 #include "system.hpp"
@@ -48,7 +49,10 @@
         services.getJournal().logError("Unable to monitor sensors for rail " +
                                        rail.getID());
 
-        // TODO: Create error log entry
+        // Create error log entry
+        // TODO: Add ErrorHistory data member and specify as parameter below
+        error_logging_utils::logError(std::current_exception(),
+                                      Entry::Level::Warning, services);
     }
 }