summaryrefslogtreecommitdiffstats
path: root/testit.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 /testit.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 'testit.cpp')
-rw-r--r--testit.cpp23
1 files changed, 10 insertions, 13 deletions
diff --git a/testit.cpp b/testit.cpp
index 072b5d7..37bb146 100644
--- a/testit.cpp
+++ b/testit.cpp
@@ -15,7 +15,7 @@ unsigned char g_sensortype [][2] = {
uint8_t find_type_for_sensor_number(uint8_t sensor_number) {
int i=0;
- uint8_t rc;
+ uint8_t rc;
while (g_sensortype[i][0] != 0xff) {
if (g_sensortype[i][1] == sensor_number) {
@@ -38,9 +38,6 @@ char g_results_value[64];
int set_sensor_dbus_state_s(unsigned char number, const char *member, const char *value) {
- printf("Attempting to log 0x%02x via %s with a value of %s\n",
- number, member, value);
-
strcpy(g_results_method, member);
strcpy(g_results_value, value);
@@ -48,12 +45,8 @@ int set_sensor_dbus_state_s(unsigned char number, const char *member, const char
}
int set_sensor_dbus_state_y(unsigned char number, char const* member, uint8_t value) {
-
- char val[2];
-
- printf("Attempting to log Variant Sensor 0x%02x via %s with a value of 0x%02x\n",
- number, member, value);
+ char val[2];
snprintf(val, 2, "%d", value);
@@ -81,7 +74,7 @@ uint8_t testrec_procfailed[] = {0x02, 0xa9, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00
// Virtual Sensor 5, setting a Value of 0h
uint8_t testrec_bootprogress[] = {0x05, 0xa9, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x0E, 0x00};
-// Virtual Sensor setting a boot count
+// Virtual Sensor setting a boot count
uint8_t testrec_bootcount[] = {0x01, 0x09, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
// Invalid sensor number
@@ -89,12 +82,16 @@ uint8_t testrec_invalidnumber[]= {0x35, 0xa9, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00
int check_results(int rc, const char *method, const char *value) {
- if (strcmp(g_results_method, method)) {
- printf("ERROR: Method Failed, expect %s found %s\n", method, g_results_method);
+ if (strcmp(g_results_method, method)) {
+ log<level::ERR>("Method Failed",
+ entry("EXPECT=%s", method),
+ entry("GOT=%s", g_results_method));
return -1;
}
if (strcmp(g_results_value, value)) {
- printf("ERROR: Value failed, expected %s found %s\n", value, g_results_value);
+ log<level::ERR>("Value failed",
+ entry("EXPECT=%s", value),
+ entry("GOT=%s", g_results_method));
return -2;
}
OpenPOWER on IntegriCloud