manager: use new Logging.Cleared event
Modify the internal manager support for creating internal events
to be able to support the sdbusplus generated events. Transition
from the local Logging.Error.LogsCleared to the global Logging.Cleared
event. Clean up references to the old event.
Tested:
```
$ busctl --user call xyz.openbmc_project.Logging /xyz/openbmc_project/logging xyz.openbmc_project.Collection.DeleteAll DeleteAll
$ busctl --user introspect xyz.openbmc_project.Logging /xyz/openbmc_project/logging/entry/1 -l | cat
NAME TYPE SIGNATURE RESULT/VALUE FLAGS
xyz.openbmc_project.Logging.Entry interface - - -
.GetEntry method - h -
.AdditionalData property as 5 "NUMBER_OF_LOGS=210" "_CODE_FILE=../log_manager.hpp" "_CODE_FUNC=virtual void phosphor::logging::Manager::deleteAll()" "_CODE_LINE=361" "_PID=3318436" emits-change writable
.EventId property s "" emits-change writable
.Id property u 1 emits-change writable
.Message property s "xyz.openbmc_project.Logging.Cleared" emits-change writable
.Resolution property s "" emits-change writable
.Resolved property b false emits-change writable
.ServiceProviderNotify property s "xyz.openbmc_project.Logging.Entry.Notify.NotSupported" emits-change writable
.Severity property s "xyz.openbmc_project.Logging.Entry.Level.Informational" emits-change writable
.Timestamp property t 1730408674348 emits-change writable
.UpdateTimestamp property t 1730408674348 emits-change writable
```
Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
Change-Id: I470f33ae2f5bfae6bf6d6a80ac2c5f028e41da95
diff --git a/log_manager.cpp b/log_manager.cpp
index 1b0cf3f..de3509d 100644
--- a/log_manager.cpp
+++ b/log_manager.cpp
@@ -6,6 +6,7 @@
#include "elog_meta.hpp"
#include "elog_serialize.hpp"
#include "extensions.hpp"
+#include "lib/lg2_commit.hpp"
#include "paths.hpp"
#include "util.hpp"
@@ -259,6 +260,13 @@
return objPath;
}
+auto Manager::createFromEvent(sdbusplus::exception::generated_event_base&&
+ event) -> sdbusplus::message::object_path
+{
+ auto [msg, level, data] = lg2::details::extractEvent(std::move(event));
+ return this->createEntry(msg, level, std::move(data));
+}
+
bool Manager::isQuiesceOnErrorEnabled()
{
// When running under tests, the Logging.Settings service will not be