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>
diff --git a/testaddsel.cpp b/testaddsel.cpp
index 90f63a2..55cf07d 100644
--- a/testaddsel.cpp
+++ b/testaddsel.cpp
@@ -27,32 +27,37 @@
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 @@
/* 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;
}