Fix Host time is not getting printed to journal
log<level::DEBUG> is not putting Host time into journal, instead it is
putting it in the metadata. Made fix for it.
Testing:
ipmitool sel time get # Host time:xxx XXX x xx:xx:xx xxxx will be
# printed in into journal
Change-Id: I0ba72a871469a30c605ee3ec91a07787959d5ae3
Signed-off-by: Nagaraju Goruganti <ngorugan@in.ibm.com>
diff --git a/storagehandler.cpp b/storagehandler.cpp
index 3f1ebe2..c020948 100644
--- a/storagehandler.cpp
+++ b/storagehandler.cpp
@@ -433,6 +433,7 @@
using namespace std::chrono;
uint64_t host_time_usec = 0;
uint32_t resp = 0;
+ std::stringstream hostTime;
try
{
@@ -469,8 +470,9 @@
return IPMI_CC_UNSPECIFIED_ERROR;
}
- log<level::DEBUG>("Host time:",
- entry("HOST_TIME=%s", getTimeString(host_time_usec)));
+ hostTime << "Host time:" << getTimeString(host_time_usec);
+ log<level::DEBUG>(hostTime.str().c_str());
+
// Time is really long int but IPMI wants just uint32. This works okay until
// the number of seconds since 1970 overflows uint32 size.. Still a whole