summaryrefslogtreecommitdiffstats
path: root/testaddsel.cpp
diff options
context:
space:
mode:
authorAditya Saripalli <adisarip@in.ibm.com>2017-11-09 14:46:27 +0530
committerVernon Mauery <vernon.mauery@linux.intel.com>2018-04-18 21:02:48 +0000
commit5fb14603817baad7418b627ca41927d9ec7c4fc9 (patch)
tree91607e546db5d8bbee17e40c0c8b28c2aaa082c6 /testaddsel.cpp
parent7ebd246403417294fc6fa1914967b6e60a92f062 (diff)
downloadphosphor-host-ipmid-5fb14603817baad7418b627ca41927d9ec7c4fc9.tar.gz
phosphor-host-ipmid-5fb14603817baad7418b627ca41927d9ec7c4fc9.zip
Reducing IPMI logging footprint
-host-ipmid is very noisy in terms of journal logging. A small step towards cleaning that up. -Also converted printfs to phosphor-logging. Partially Resolves openbmc/openbmc#2507 Change-Id: I749c19c18d1cabf6f0216830c8cb0a08ee43d6de Signed-off-by: Aditya Saripalli <aditya0124@gmail.com> Signed-off-by: Nagaraju Goruganti <ngorugan@in.ibm.com>
Diffstat (limited to 'testaddsel.cpp')
-rw-r--r--testaddsel.cpp21
1 files changed, 13 insertions, 8 deletions
diff --git a/testaddsel.cpp b/testaddsel.cpp
index 90f63a2..55cf07d 100644
--- a/testaddsel.cpp
+++ b/testaddsel.cpp
@@ -27,32 +27,37 @@ int find_openbmc_path(const uint8_t num, dbus_interface_t *interface) {
r = mapper_get_service(bus, objname, &busname);
if (r < 0) {
- fprintf(stderr, "Failed to get %s busname: %s\n",
- objname, strerror(-r));
+ log<level::ERR>("Failed to get busname",
+ entry("BUS=%s", objname),
+ entry("ERRNO=0x%X", -r));
goto final;
}
r = sd_bus_message_new_method_call(bus,&m,busname,objname,busname,"getObjectFromByteId");
if (r < 0) {
- fprintf(stderr, "Failed to create a method call: %s", strerror(-r));
+ log<level::ERR>("Failed to create a method call",
+ entry("ERRNO=0x%X", -r));
}
r = sd_bus_message_append(m, "sy", type, num);
if (r < 0) {
- fprintf(stderr, "Failed to create a input parameter: %s", strerror(-r));
+ log<level::ERR>("Failed to create a input parameter",
+ entry("ERRNO=0x%X", -r));
}
// Call the IPMI responder on the bus so the message can be sent to the CEC
r = sd_bus_call(bus, m, 0, &error, &reply);
if (r < 0) {
- fprintf(stderr, "Failed to call the method: %s", strerror(-r));
+ log<level::ERR>("Failed to call the method",
+ entry("ERRNO=0x%X", -r));
goto final;
}
r = sd_bus_message_read(reply, "(sss)", &str1, &str2, &str3);
if (r < 0) {
- fprintf(stderr, "Failed to get a response: %s", strerror(-r));
+ log<level::ERR>("Failed to get a response",
+ entry("ERRNO=0x%X", -r));
goto final;
}
@@ -99,8 +104,8 @@ int main(int argc, char *argv[])
/* Connect to system bus */
r = sd_bus_open_system(&bus);
if (r < 0) {
- fprintf(stderr, "Failed to connect to system bus: %s\n",
- strerror(-r));
+ log<level::ERR>("Failed to connect to system bus",
+ entry("ERRNO=0x%X", -r));
goto finish;
}
OpenPOWER on IntegriCloud