regulators: Create error_logging_utils

Create the error_logging_utils namespace for utility functions that make
it easier to log errors.  Create two initial functions within the
namespace.

The first function logs an error based on an exception.  The exception
may have one or more nested inner exceptions.  The function finds the
highest priority exception and logs a corresponding error.

The second function provides the same basic behavior as the first, but
it adds an ErrorHistory parameter.  An error will only be logged if it
was not previously logged.  The ErrorHistory object is used to
determine whether an error has been previously logged.  This avoids
logging duplicate errors if a regulator operation is occurring
repeatedly, such as reading sensor values.

Signed-off-by: Shawn McCarney <shawnmm@us.ibm.com>
Change-Id: If246cde9a0f60c5bba34ae4a0d68fb511c0024fc
diff --git a/phosphor-regulators/src/meson.build b/phosphor-regulators/src/meson.build
index 9993591..40cb3e8 100644
--- a/phosphor-regulators/src/meson.build
+++ b/phosphor-regulators/src/meson.build
@@ -10,6 +10,7 @@
     'configuration.cpp',
     'device.cpp',
     'error_logging.cpp',
+    'error_logging_utils.cpp',
     'exception_utils.cpp',
     'ffdc_file.cpp',
     'id_map.cpp',