Create new Elog class

Created new Elog callback, which will create an error log.
This is just the base, more to come.

Change-Id: I50c12c8bff0942b5cb027e38d0cc8691e8a241b4
Signed-off-by: Gunnar Mills <gmills@us.ibm.com>
diff --git a/src/elog.hpp b/src/elog.hpp
new file mode 100644
index 0000000..f138b0b
--- /dev/null
+++ b/src/elog.hpp
@@ -0,0 +1,69 @@
+#pragma once
+#include <phosphor-logging/elog-errors.hpp>
+#include <phosphor-logging/elog.hpp>
+#include "callback.hpp"
+#include <sdbusplus/exception.hpp>
+
+namespace phosphor
+{
+namespace dbus
+{
+namespace monitoring
+{
+
+/** @class ElogBase
+ *  @brief Elog callback implementation.
+ *
+ *  The elog callback logs the elog and
+ *  elog metadata.
+ */
+class ElogBase : public Callback
+{
+    public:
+        ElogBase(const ElogBase&) = delete;
+        ElogBase(ElogBase&&) = default;
+        ElogBase& operator=(const ElogBase&) = delete;
+        ElogBase& operator=(ElogBase&&) = default;
+        virtual ~ElogBase() = default;
+        ElogBase() :
+            Callback(){}
+
+        /** @brief Callback interface implementation. */
+        void operator()() override;
+
+    private:
+        /** @brief Delegate type specific calls to subclasses. */
+        virtual void log() const = 0;
+};
+
+
+/** @class Elog
+ *  @brief C++ type specific logic for the elog callback.
+ *
+ *  @tparam T - Error log type
+ */
+template <typename T>
+class Elog : public ElogBase
+{
+    public:
+        Elog(const Elog&) = delete;
+        Elog(Elog&&) = default;
+        Elog& operator=(const Elog&) = delete;
+        Elog& operator=(Elog&&) = default;
+        ~Elog() = default;
+        Elog() :
+            ElogBase() {}
+
+    private:
+        /** @brief elog interface implementation. */
+        void log() const override
+        {
+
+            using namespace phosphor::logging;
+            report<T>();
+        }
+};
+
+} // namespace monitoring
+} // namespace dbus
+} // namespace phosphor