diff options
author | Nagaraju Goruganti <ngorugan@in.ibm.com> | 2018-04-29 22:38:40 -0500 |
---|---|---|
committer | Vernon Mauery <vernon.mauery@linux.intel.com> | 2018-05-08 21:48:04 +0000 |
commit | 8960b7c2ed473624932c1cf407b94310881308e6 (patch) | |
tree | d4247fb7f0c017c2eada5bd7baf6c1575f1cf0b8 /storagehandler.cpp | |
parent | e98d146addcab8a25037f927673c0616cde7d962 (diff) | |
download | phosphor-host-ipmid-8960b7c2ed473624932c1cf407b94310881308e6.tar.gz phosphor-host-ipmid-8960b7c2ed473624932c1cf407b94310881308e6.zip |
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>
Diffstat (limited to 'storagehandler.cpp')
-rw-r--r-- | storagehandler.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/storagehandler.cpp b/storagehandler.cpp index 3f1ebe2..c020948 100644 --- a/storagehandler.cpp +++ b/storagehandler.cpp @@ -433,6 +433,7 @@ ipmi_ret_t ipmi_storage_get_sel_time(ipmi_netfn_t netfn, ipmi_cmd_t cmd, using namespace std::chrono; uint64_t host_time_usec = 0; uint32_t resp = 0; + std::stringstream hostTime; try { @@ -469,8 +470,9 @@ ipmi_ret_t ipmi_storage_get_sel_time(ipmi_netfn_t netfn, ipmi_cmd_t cmd, 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 |