summaryrefslogtreecommitdiffstats
path: root/elog_entry.hpp
diff options
context:
space:
mode:
authorAdriana Kobylak <anoo@us.ibm.com>2017-01-10 12:52:34 -0600
committerAdriana Kobylak <anoo@us.ibm.com>2017-02-14 09:18:31 -0600
commit4ea7f312c508af64634a3e308b8641d39c581e37 (patch)
treeb91b350559e3025811060705d1dbb9f0d90f76d1 /elog_entry.hpp
parent9316b9ac43d704a66591ae5e755599db8acef632 (diff)
downloadphosphor-logging-4ea7f312c508af64634a3e308b8641d39c581e37.tar.gz
phosphor-logging-4ea7f312c508af64634a3e308b8641d39c581e37.zip
Entry: Populate properties
Create an Entry dbus object when Commit is called and fill in its properties with the journal data. Change-Id: I155cacbdfdccfa8b1f594503d858710fa71f2026 Signed-off-by: Adriana Kobylak <anoo@us.ibm.com>
Diffstat (limited to 'elog_entry.hpp')
-rw-r--r--elog_entry.hpp23
1 files changed, 21 insertions, 2 deletions
diff --git a/elog_entry.hpp b/elog_entry.hpp
index bd3915c..92360cb 100644
--- a/elog_entry.hpp
+++ b/elog_entry.hpp
@@ -35,11 +35,30 @@ class Entry : public details::ServerObject<details::EntryIface>
virtual ~Entry() = default;
/** @brief Constructor to put object onto bus at a dbus path.
+ * Defer signal registration (pass true for deferSignal to the
+ * base class) until after the properties are set.
* @param[in] bus - Bus to attach to.
* @param[in] path - Path to attach at.
+ * @param[in] properties - Desired Entry properties.
*/
- Entry(sdbusplus::bus::bus& bus, const char* path) :
- details::ServerObject<details::EntryIface>(bus, path) {};
+ Entry(sdbusplus::bus::bus& bus,
+ const std::string& path,
+ uint32_t idErr,
+ Level severityErr,
+ std::string&& msgErr,
+ std::vector<std::string>&& additionalDataErr) :
+ details::ServerObject<details::EntryIface>
+ (bus, path.c_str(), true)
+ {
+ id(idErr);
+ severity(severityErr);
+ message(std::move(msgErr));
+ additionalData(std::move(additionalDataErr));
+
+ // Emit deferred signal.
+ this->emit_object_added();
+ };
+
};
} // namespace logging
OpenPOWER on IntegriCloud