regulators: Add phase faults to ErrorLogging

Enhance the ErrorLogging class hierarchy to log phase fault errors.
Support specifying additional error data that may have been collected
from the device.

Tested:
* Logged an N phase fault error
* Logged an N+1 phase fault error
* Verified mock logPhaseFault() method could be used in a gtest.

Signed-off-by: Shawn McCarney <shawnmm@us.ibm.com>
Change-Id: I67efb7e16bb3fc5a071ccc60a949bba30daf3e78
diff --git a/phosphor-regulators/src/error_logging.hpp b/phosphor-regulators/src/error_logging.hpp
index ba95561..e6abfbe 100644
--- a/phosphor-regulators/src/error_logging.hpp
+++ b/phosphor-regulators/src/error_logging.hpp
@@ -17,6 +17,7 @@
 
 #include "ffdc_file.hpp"
 #include "journal.hpp"
+#include "phase_fault.hpp"
 #include "xyz/openbmc_project/Logging/Create/server.hpp"
 #include "xyz/openbmc_project/Logging/Entry/server.hpp"
 
@@ -98,6 +99,23 @@
     virtual void logInternalError(Entry::Level severity, Journal& journal) = 0;
 
     /**
+     * Log a phase fault error.
+     *
+     * This error is logged when a regulator has lost a redundant phase.
+     *
+     * @param severity severity level
+     * @param journal system journal
+     * @param type phase fault type
+     * @param inventoryPath D-Bus inventory path of the device where the error
+     *                      occurred
+     * @param additionalData additional error data (if any)
+     */
+    virtual void
+        logPhaseFault(Entry::Level severity, Journal& journal,
+                      PhaseFaultType type, const std::string& inventoryPath,
+                      std::map<std::string, std::string> additionalData) = 0;
+
+    /**
      * Log a PMBus error.
      *
      * This error is logged when the I2C communication was successful, but the
@@ -168,6 +186,12 @@
     virtual void logInternalError(Entry::Level severity,
                                   Journal& journal) override;
 
+    /** @copydoc ErrorLogging::logPhaseFault() */
+    virtual void logPhaseFault(
+        Entry::Level severity, Journal& journal, PhaseFaultType type,
+        const std::string& inventoryPath,
+        std::map<std::string, std::string> additionalData) override;
+
     /** @copydoc ErrorLogging::logPMBusError() */
     virtual void logPMBusError(Entry::Level severity, Journal& journal,
                                const std::string& inventoryPath) override;