elog: ensure new sdbusplus events cannot be committed directly

sdbusplus events should not be committed in the old way, because
they have their metadata directly in the class rather than using
the side-band metadata YAML (from phosphor-logging).  Add compile-time
asserts to ensure they cannot be used with the older interfaces.

Tested:

Create a simple test:
```
    phosphor::logging::report<
        sdbusplus::event::xyz::openbmc_project::Logging::Cleared>();
```

Which fails to compile as follows:
```
In file included from ../test/basic_event_commit.cpp:3:
../lib/include/phosphor-logging/elog.hpp: In instantiation of ‘uint32_t phosphor::logging::report(Args ...) [with T = sdbusplus::event::xyz::openbmc_project::Logging::Cleared; Args = {}; uint32_t = unsigned int]’:
../test/basic_event_commit.cpp:13:66:   required from here
../lib/include/phosphor-logging/elog.hpp:205:15: error: static assertion failed: T must NOT be an sdbusplus::generated_event
  205 |         !std::is_base_of_v<sdbusplus::exception::generated_event<T>, T>,
```

Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
Change-Id: I9cfc6915d125545067082a4fff717443aedd1531
diff --git a/lib/include/phosphor-logging/elog.hpp b/lib/include/phosphor-logging/elog.hpp
index 228f549..15bbf01 100644
--- a/lib/include/phosphor-logging/elog.hpp
+++ b/lib/include/phosphor-logging/elog.hpp
@@ -129,8 +129,12 @@
 uint32_t commit()
 {
     // Validate if the exception is derived from sdbusplus::exception.
-    static_assert(std::is_base_of<sdbusplus::exception_t, T>::value,
+    static_assert(std::is_base_of_v<sdbusplus::exception_t, T>,
                   "T must be a descendant of sdbusplus::exception_t");
+    static_assert(
+        !std::is_base_of_v<sdbusplus::exception::generated_event<T>, T>,
+        "T must NOT be an sdbusplus::generated_event");
+
     return details::commit(T::errName);
 }
 
@@ -145,8 +149,12 @@
 uint32_t commit(Entry::Level level)
 {
     // Validate if the exception is derived from sdbusplus::exception.
-    static_assert(std::is_base_of<sdbusplus::exception_t, T>::value,
+    static_assert(std::is_base_of_v<sdbusplus::exception_t, T>,
                   "T must be a descendant of sdbusplus::exception_t");
+    static_assert(
+        !std::is_base_of_v<sdbusplus::exception::generated_event<T>, T>,
+        "T must NOT be an sdbusplus::generated_event");
+
     return details::commit(T::errName, level);
 }
 
@@ -160,14 +168,17 @@
 [[noreturn]] void elog(Args... i_args)
 {
     // Validate if the exception is derived from sdbusplus::exception.
-    static_assert(std::is_base_of<sdbusplus::exception_t, T>::value,
+    static_assert(std::is_base_of_v<sdbusplus::exception_t, T>,
                   "T must be a descendant of sdbusplus::exception_t");
+    static_assert(
+        !std::is_base_of_v<sdbusplus::exception::generated_event<T>, T>,
+        "T must NOT be an sdbusplus::generated_event");
 
     // Validate the caller passed in the required parameters
-    static_assert(
-        std::is_same<typename details::map_exception_type_t<T>::metadata_types,
-                     std::tuple<details::deduce_entry_type_t<Args>...>>::value,
-        "You are not passing in required arguments for this error");
+    static_assert(std::is_same_v<
+                      typename details::map_exception_type_t<T>::metadata_types,
+                      std::tuple<details::deduce_entry_type_t<Args>...>>,
+                  "You are not passing in required arguments for this error");
 
     log<details::map_exception_type_t<T>::L>(
         T::errDesc, details::deduce_entry_type<Args>{i_args}.get()...);
@@ -188,14 +199,17 @@
 uint32_t report(Args... i_args)
 {
     // validate if the exception is derived from sdbusplus::exception.
-    static_assert(std::is_base_of<sdbusplus::exception_t, T>::value,
+    static_assert(std::is_base_of_v<sdbusplus::exception_t, T>,
                   "T must be a descendant of sdbusplus::exception_t");
+    static_assert(
+        !std::is_base_of_v<sdbusplus::exception::generated_event<T>, T>,
+        "T must NOT be an sdbusplus::generated_event");
 
     // Validate the caller passed in the required parameters
-    static_assert(
-        std::is_same<typename details::map_exception_type_t<T>::metadata_types,
-                     std::tuple<details::deduce_entry_type_t<Args>...>>::value,
-        "You are not passing in required arguments for this error");
+    static_assert(std::is_same_v<
+                      typename details::map_exception_type_t<T>::metadata_types,
+                      std::tuple<details::deduce_entry_type_t<Args>...>>,
+                  "You are not passing in required arguments for this error");
 
     log<details::map_exception_type_t<T>::L>(
         T::errDesc, details::deduce_entry_type<Args>{i_args}.get()...);
@@ -217,14 +231,17 @@
 uint32_t report(Entry::Level level, Args... i_args)
 {
     // validate if the exception is derived from sdbusplus::exception.
-    static_assert(std::is_base_of<sdbusplus::exception_t, T>::value,
+    static_assert(std::is_base_of_v<sdbusplus::exception_t, T>,
                   "T must be a descendant of sdbusplus::exception_t");
+    static_assert(
+        !std::is_base_of_v<sdbusplus::exception::generated_event<T>, T>,
+        "T must NOT be an sdbusplus::generated_event");
 
     // Validate the caller passed in the required parameters
-    static_assert(
-        std::is_same<typename details::map_exception_type_t<T>::metadata_types,
-                     std::tuple<details::deduce_entry_type_t<Args>...>>::value,
-        "You are not passing in required arguments for this error");
+    static_assert(std::is_same_v<
+                      typename details::map_exception_type_t<T>::metadata_types,
+                      std::tuple<details::deduce_entry_type_t<Args>...>>,
+                  "You are not passing in required arguments for this error");
 
     log<details::map_exception_type_t<T>::L>(
         T::errDesc, details::deduce_entry_type<Args>{i_args}.get()...);