summaryrefslogtreecommitdiffstats
path: root/testaddsel.cpp
diff options
context:
space:
mode:
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