summaryrefslogtreecommitdiffstats
path: root/elog.cpp
diff options
context:
space:
mode:
authorMarri Devender Rao <devenrao@in.ibm.com>2017-04-04 03:43:00 -0500
committerPatrick Williams <patrick@stwcx.xyz>2017-04-12 20:54:46 +0000
commit7d0a07ba3205807b5c2f5c84261d7a9cc295decb (patch)
tree6f27e0f73485cf5fb90db1ea947ccd8766bcd891 /elog.cpp
parent8110ca6d243bbec89e5ce3be644883bf0dadd23d (diff)
downloadphosphor-logging-7d0a07ba3205807b5c2f5c84261d7a9cc295decb.tar.gz
phosphor-logging-7d0a07ba3205807b5c2f5c84261d7a9cc295decb.zip
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 <devenrao@in.ibm.com>
Diffstat (limited to 'elog.cpp')
-rw-r--r--elog.cpp15
1 files changed, 12 insertions, 3 deletions
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<std::string>(e));
+ m.append(id, name);
b.call_noreply(m);
}
+} // namespace details
+
+void commit(std::string&& name)
+{
+ log<level::ERR>("method is deprecated, use commit() with exception type");
+ phosphor::logging::details::commit(name.c_str());
+}
} // namespace logging
} // namespace phosphor
OpenPOWER on IntegriCloud