lg2: commit: simplify commit functions
Eliminate the template indirection for the commit function in favor
of a base-class overload. There was previously a public template
specialization of `lg2::commit` and a private base-class implementation
(in the `details` namespace). The template implementations provided
no stronger type-checking, since it was already a concept requiring
inheritance from the base-class. The template precluded simple code
such as:
```cpp
try
{
//...
}
catch (const sdbusplus::exception::generated_event_base& e)
{
lg2::commit(e);
}
```
By making the base-class types public, rather than hidden in the
details namespace, and removing the templates, the code is simpler
and more usable.
Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
Change-Id: If0a3e1331eff36aec4b9f7e4950636360d59306e
diff --git a/log_create_main.cpp b/log_create_main.cpp
index 4347152..9d6b569 100644
--- a/log_create_main.cpp
+++ b/log_create_main.cpp
@@ -35,7 +35,7 @@
}
catch (sdbusplus::exception::generated_event_base& e)
{
- auto path = lg2::details::commit(std::move(e));
+ auto path = lg2::commit(std::move(e));
std::cout << path.str << std::endl;
return 0;
}