From 7d0a07ba3205807b5c2f5c84261d7a9cc295decb Mon Sep 17 00:00:00 2001 From: Marri Devender Rao Date: Tue, 4 Apr 2017 03:43:00 -0500 Subject: Add new commit API and deprecate older commit method Added new commit method that accepts an sdbusplus exception Deprecate commit which accepts an exception name Change-Id: I9b5c91eb13466eb576c329ebb7fd00ce33f7dd9f Signed-off-by: Marri Devender Rao --- elog.cpp | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) (limited to 'elog.cpp') diff --git a/elog.cpp b/elog.cpp index 5483851..27dfef5 100644 --- a/elog.cpp +++ b/elog.cpp @@ -5,9 +5,11 @@ namespace phosphor { namespace logging { - -void commit(std::string&& e) +namespace details +{ +void commit(const char* name) { + using phosphor::logging::log; constexpr auto MAPPER_BUSNAME = "xyz.openbmc_project.ObjectMapper"; constexpr auto MAPPER_PATH = "/xyz/openbmc_project/object_mapper"; constexpr auto MAPPER_INTERFACE = "xyz.openbmc_project.ObjectMapper"; @@ -46,9 +48,16 @@ void commit(std::string&& e) IFACE_INTERNAL, "Commit"); uint64_t id = sdbusplus::server::transaction::get_id(); - m.append(id, std::forward(e)); + m.append(id, name); b.call_noreply(m); } +} // namespace details + +void commit(std::string&& name) +{ + log("method is deprecated, use commit() with exception type"); + phosphor::logging::details::commit(name.c_str()); +} } // namespace logging } // namespace phosphor -- cgit v1.2.1