summaryrefslogtreecommitdiffstats
path: root/storageaddsel.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 /storageaddsel.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 'storageaddsel.cpp')
-rw-r--r--storageaddsel.cpp17
1 files changed, 9 insertions, 8 deletions
diff --git a/storageaddsel.cpp b/storageaddsel.cpp
index 2b41d56..c662502 100644
--- a/storageaddsel.cpp
+++ b/storageaddsel.cpp
@@ -94,20 +94,21 @@ size_t getfilestream(const char *fn, uint8_t **buffer) {
r = fseek(fp, 0, SEEK_END);
if (r) {
- fprintf(stderr,"Fseek failed\n");
+ log<level::ERR>("Fseek failed");
goto fclose_fp;
}
size = ftell(fp);
if (size == -1L) {
- fprintf(stderr,"Ftell failed for %s\n", strerror(errno));
+ log<level::ERR>("Ftell failed",
+ entry("ERROR=%s", strerror(errno)));
size = 0;
goto fclose_fp;
}
r = fseek(fp, 0, SEEK_SET);
if (r) {
- fprintf(stderr,"Fseek failed\n");
+ log<level::ERR>("Fseek failed");
size = 0;
goto fclose_fp;
}
@@ -117,7 +118,7 @@ size_t getfilestream(const char *fn, uint8_t **buffer) {
r = fread(*buffer, 1, size, fp);
if ( r != size) {
size = 0;
- fprintf(stderr,"Fread failed\n");
+ log<level::ERR>("Fread failed\n");
}
fclose_fp:
@@ -181,8 +182,7 @@ int create_esel_description(const uint8_t *buffer, Entry::Level level,
r = asprintf(message, "A %s has experienced an error of level %d",
m, static_cast<uint32_t>(level) );
if (r == -1) {
- fprintf(stderr,
- "Failed to allocate memory for ESEL description\n");
+ log<level::ERR>("Failed to allocate memory for ESEL description");
}
free(m);
@@ -229,7 +229,8 @@ void send_esel(uint16_t recordid) {
sz = getfilestream(path, &buffer);
if (sz == 0) {
- printf("Error file does not exist %d\n",__LINE__);
+ log<level::ERR>("Error file does not exist",
+ entry("FILENAME=%s", path));
return;
}
@@ -239,7 +240,7 @@ void send_esel(uint16_t recordid) {
r = send_esel_to_dbus(desc, sev, inventoryPath, buffer, sz);
if (r < 0) {
- fprintf(stderr, "Failed to send esel to dbus\n");
+ log<level::ERR>("Failed to send esel to dbus");
}
free(desc);
OpenPOWER on IntegriCloud