Remove inheriting from sdbus exception for error metadata

For logging/reporting exceptions, applications need to use exceptions
generated by using sdbus++.

For metadata, use header file generated by elog-gen script.

Change-Id: Id8f61f8692bfd694d8875359d883465c1124bedf
Signed-off-by: Marri Devender Rao <devenrao@in.ibm.com>
diff --git a/tools/phosphor-logging/templates/elog-gen-template.mako.hpp b/tools/phosphor-logging/templates/elog-gen-template.mako.hpp
index 6a3ffbf..670f8f5 100644
--- a/tools/phosphor-logging/templates/elog-gen-template.mako.hpp
+++ b/tools/phosphor-logging/templates/elog-gen-template.mako.hpp
@@ -79,6 +79,11 @@
 
 }  // namespace _${classname}
 <%
+    example_yaml = False
+    if("example.xyz.openbmc_project" in name):
+        example_yaml = True
+%>\
+<%
     meta_string = ""
     if(meta_list):
         meta_string = ', '.join(meta_list)
@@ -100,12 +105,17 @@
             meta_string = parent_meta_short
         parent = parents[parent]
 
-    error_type = classname + " : public sdbusplus::exception_t"
+    if example_yaml:
+        error_type = classname + " : public sdbusplus::exception_t"
+    else:
+        error_type = classname
 %>
 struct ${error_type}
 {
+    % if example_yaml:
     static constexpr auto errName = "${name}";
     static constexpr auto errDesc = "${error_msg[name]}";
+    % endif
     static constexpr auto L = level::${error_lvl[name]};
     % for b in meta_list:
     using ${b} = _${classname}::${b};
@@ -115,6 +125,7 @@
     % endfor
     using metadata_types = std::tuple<${meta_string}>;
 
+    % if example_yaml:
     const char* name() const noexcept
     {
         return errName;
@@ -129,6 +140,7 @@
     {
         return errName;
     }
+    % endif
 };
 
 % for s in reversed(namespaces):
@@ -137,14 +149,14 @@
 
 <%
     sdbusplus_name = name
-    if("example.xyz.openbmc_project" not in name):
+    if not example_yaml :
         sdbusplus_name = "sdbusplus." + sdbusplus_name
         pos = sdbusplus_name.rfind(".")
         sdbusplus_name = (sdbusplus_name[:pos] + ".Error." +
                           sdbusplus_name[pos+1:])
     sdbusplus_type = sdbusplus_name.replace(".", "::")
     phosphor_type = sdbusplus_type
-    if("example.xyz.openbmc_project" not in name):
+    if not example_yaml :
         phosphor_type = sdbusplus_type.replace("sdbusplus::", "")
         phosphor_type = phosphor_type.replace("Error::", "")
 %>\