summaryrefslogtreecommitdiffstats
path: root/sdevent/source.hpp
diff options
context:
space:
mode:
authorMarri Devender Rao <devenrao@in.ibm.com>2017-11-07 04:58:14 -0600
committerBrad Bishop <bradleyb@fuzziesquirrel.com>2017-11-16 20:35:43 +0000
commit6088558429fbe5f723783b4220b6ac1c9096cde9 (patch)
tree3fb71a2014e4e65f3070711c3219442da042d308 /sdevent/source.hpp
parent67967f9a3f8e779d897a66cc6d559783911b2c14 (diff)
downloadphosphor-fan-presence-6088558429fbe5f723783b4220b6ac1c9096cde9.tar.gz
phosphor-fan-presence-6088558429fbe5f723783b4220b6ac1c9096cde9.zip
Fix up InternalFailure to include metadata
Scope is to add missing logs for InternalFailure errors Change-Id: I12c958127c1303fba0057914682e651457a0e547 Signed-off-by: Marri Devender Rao <devenrao@in.ibm.com>
Diffstat (limited to 'sdevent/source.hpp')
-rw-r--r--sdevent/source.hpp11
1 files changed, 9 insertions, 2 deletions
diff --git a/sdevent/source.hpp b/sdevent/source.hpp
index be3a892..e90efd4 100644
--- a/sdevent/source.hpp
+++ b/sdevent/source.hpp
@@ -32,6 +32,8 @@ using source = std::unique_ptr<sd_event_source, SourceDeleter>;
} // namespace details
+using namespace phosphor::logging;
+
/** @class Source
* @brief Provides C++ bindings to the sd_event_source* functions.
*/
@@ -83,7 +85,9 @@ class Source
auto rc = sd_event_source_get_enabled(src.get(), &enabled);
if (rc < 0)
{
- phosphor::logging::elog<InternalFailure>();
+ log<level::ERR>("Error in call to sd_event_source_get_enabled",
+ entry("RC=%d", rc));
+ elog<InternalFailure>();
}
return enabled;
@@ -95,7 +99,10 @@ class Source
auto rc = sd_event_source_set_enabled(src.get(), enable);
if (rc < 0)
{
- phosphor::logging::elog<InternalFailure>();
+ log<level::ERR>("Error in call to sd_event_source_set_enabled",
+ entry("RC=%d", rc),
+ entry("ENABLE=%d", enable));
+ elog<InternalFailure>();
}
}
OpenPOWER on IntegriCloud