Log message cleanup
Removed std::endl from log messages.
Signed-off-by: Ben Tyner <ben.tyner@ibm.com>
Change-Id: Iec49cfb9d1c6fef8bdea2c88e203c45093e2973d
diff --git a/attn/attn_handler.cpp b/attn/attn_handler.cpp
index af62771..65d980a 100644
--- a/attn/attn_handler.cpp
+++ b/attn/attn_handler.cpp
@@ -62,37 +62,33 @@
proc = pdbg_target_index(target); // get processor number
std::stringstream ss; // log message stream
- ss << "checking processor " << proc << std::endl;
+ ss << "checking processor " << proc;
log<level::INFO>(ss.str().c_str());
// get active attentions on processor
if (RC_SUCCESS != fsi_read(target, 0x1007, &isr_val))
{
- std::stringstream ss; // log message stream
- ss << "Error! cfam read 0x1007 FAILED" << std::endl;
- log<level::INFO>(ss.str().c_str());
+ log<level::INFO>("Error! cfam read 0x1007 FAILED");
}
else
{
std::stringstream ss; // log message stream
ss << "cfam 0x1007 = 0x";
ss << std::hex << std::setw(8) << std::setfill('0');
- ss << isr_val << std::endl;
+ ss << isr_val;
log<level::INFO>(ss.str().c_str());
// get interrupt enabled special attentions mask
if (RC_SUCCESS != fsi_read(target, 0x100d, &isr_mask))
{
- std::stringstream ss; // log message stream
- ss << "Error! cfam read 0x100d FAILED" << std::endl;
- log<level::INFO>(ss.str().c_str());
+ log<level::INFO>("Error! cfam read 0x100d FAILED");
}
else
{
std::stringstream ss; // log message stream
ss << "cfam 0x100d = 0x";
ss << std::hex << std::setw(8) << std::setfill('0');
- ss << isr_mask << std::endl;
+ ss << isr_mask;
log<level::INFO>(ss.str().c_str());
// bit 0 on "left": bit 30 = SBE vital attention
@@ -153,15 +149,11 @@
{
int rc = RC_NOT_SUCCESS; // vital attention handling not yet supported
- std::stringstream ss; // log message stream
- ss << "vital" << std::endl;
- log<level::INFO>(ss.str().c_str());
+ log<level::INFO>("vital");
if (RC_SUCCESS != rc)
{
- std::stringstream ss; // log message stream
- ss << "vital NOT handled" << std::endl;
- log<level::INFO>(ss.str().c_str());
+ log<level::INFO>("vital NOT handled");
}
return rc;
@@ -174,14 +166,10 @@
{
int rc = RC_SUCCESS; // checkstop handling supported
- std::stringstream ss; // log message stream
- ss << "checkstop" << std::endl;
- log<level::INFO>(ss.str().c_str());
+ log<level::INFO>("checkstop");
analyzer::analyzeHardware();
- // TODO recoverable errors?
-
return rc;
}
@@ -192,17 +180,14 @@
{
int rc = RC_SUCCESS; // special attention handling supported
- std::stringstream ss; // log message stream
-
- ss << "special" << std::endl;
+ log<level::INFO>("special");
// Right now we always handle breakpoint special attentions if breakpoint
// attn handling is enabled. This will eventually check if breakpoint attn
// handing is enabled AND there is a breakpoint pending.
if (0 != (i_attention->getFlags() & enableBreakpoints))
{
- ss << "breakpoint" << std::endl;
- log<level::INFO>(ss.str().c_str());
+ log<level::INFO>("breakpoint");
// Call the breakpoint special attention handler
bpHandler();
@@ -213,8 +198,7 @@
// handling is enbaled or not.
else
{
- ss << "TI (terminate immediately)" << std::endl;
- log<level::INFO>(ss.str().c_str());
+ log<level::INFO>("TI (terminate immediately)");
// Call TI special attention handler
tiHandler();
diff --git a/attn/bp_handler.cpp b/attn/bp_handler.cpp
index 7b4744c..4ab734d 100644
--- a/attn/bp_handler.cpp
+++ b/attn/bp_handler.cpp
@@ -1,8 +1,6 @@
#include <logging.hpp>
#include <sdbusplus/bus.hpp>
-#include <sstream>
-
namespace attn
{
@@ -15,9 +13,7 @@
void bpHandler()
{
// trace message
- std::stringstream ss;
- ss << "Notify Cronus" << std::endl;
- log<level::INFO>(ss.str().c_str());
+ log<level::INFO>("Notify Cronus");
// notify Cronus over dbus
auto bus = sdbusplus::bus::new_system();
diff --git a/attn/ti_handler.cpp b/attn/ti_handler.cpp
index cca2a66..b991b6e 100644
--- a/attn/ti_handler.cpp
+++ b/attn/ti_handler.cpp
@@ -1,8 +1,6 @@
#include <logging.hpp>
#include <sdbusplus/bus.hpp>
-#include <sstream>
-
namespace attn
{
@@ -10,9 +8,7 @@
void tiHandler()
{
// trace message
- std::stringstream ss;
- ss << "start host diagnostic mode service" << std::endl;
- log<level::INFO>(ss.str().c_str());
+ log<level::INFO>("start host diagnostic mode service");
// Use the systemd service manager object interface to call the start unit
// method with the obmc-host-diagnostic-mode target.
diff --git a/test/end2end/bp_handler.cpp b/test/end2end/bp_handler.cpp
index bcb0ac3..abdf90a 100644
--- a/test/end2end/bp_handler.cpp
+++ b/test/end2end/bp_handler.cpp
@@ -1,7 +1,5 @@
#include <attn/logging.hpp>
-#include <sstream>
-
namespace attn
{
@@ -9,9 +7,7 @@
void bpHandler()
{
// trace message
- std::stringstream ss;
- ss << "breakpoint handler";
- log<level::INFO>(ss.str().c_str());
+ log<level::INFO>("breakpoint handler");
}
} // namespace attn
diff --git a/test/end2end/logging.cpp b/test/end2end/logging.cpp
index 2833766..ba0add7 100644
--- a/test/end2end/logging.cpp
+++ b/test/end2end/logging.cpp
@@ -9,7 +9,7 @@
template <>
void log<INFO>(const char* i_message)
{
- std::cout << i_message;
+ std::cout << i_message << std::endl;
}
} // namespace attn
diff --git a/test/end2end/ti_handler.cpp b/test/end2end/ti_handler.cpp
index 50cc97b..7ffb76d 100644
--- a/test/end2end/ti_handler.cpp
+++ b/test/end2end/ti_handler.cpp
@@ -1,7 +1,5 @@
#include <attn/logging.hpp>
-#include <sstream>
-
namespace attn
{
@@ -9,9 +7,7 @@
void tiHandler()
{
// trace message
- std::stringstream ss;
- ss << "TI handler" << std::endl;
- log<level::INFO>(ss.str().c_str());
+ log<level::INFO>("TI handler");
}
} // namespace attn