Attn: Cleanup trace messages 2
Replaced some uses of stringstream with std::string
Signed-off-by: Ben Tyner <ben.tyner@ibm.com>
Change-Id: I15118d47b8a9ad16dad96494136cbae9b08a6f43
diff --git a/attn/attn_dbus.cpp b/attn/attn_dbus.cpp
index 0903206..8765f43 100644
--- a/attn/attn_dbus.cpp
+++ b/attn/attn_dbus.cpp
@@ -63,17 +63,15 @@
}
else
{
- std::stringstream ss;
- ss << "dbusMethod service not found: " << i_path.c_str() << ", "
- << i_interface.c_str();
- trace<level::INFO>(ss.str().c_str());
+ std::string traceMsg =
+ "dbusMethod service not found: " + i_path + ", " + i_interface;
+ trace<level::INFO>(traceMsg.c_str());
}
}
catch (const sdbusplus::exception::SdBusError& e)
{
- std::stringstream ss;
- ss << "dbusMethod exception: " << e.what();
- trace<level::INFO>(ss.str().c_str());
+ std::string traceMsg = "dbusMethod exception: " + std::string(e.what());
+ trace<level::INFO>(traceMsg.c_str());
}
return rc;
@@ -116,9 +114,9 @@
}
catch (const sdbusplus::exception::SdBusError& e)
{
- std::stringstream ss;
- ss << "createPel exception: " << e.what();
- trace<level::INFO>(ss.str().c_str());
+ std::string traceMsg =
+ "createPel exception: " + std::string(e.what());
+ trace<level::INFO>(traceMsg.c_str());
}
}
@@ -170,9 +168,9 @@
}
catch (const sdbusplus::exception::SdBusError& e)
{
- std::stringstream ss;
- ss << "createPelRaw exception: " << e.what();
- trace<level::INFO>(ss.str().c_str());
+ std::string traceMsg =
+ "createPelRaw exception: " + std::string(e.what());
+ trace<level::INFO>(traceMsg.c_str());
}
}
}
@@ -210,9 +208,8 @@
}
catch (const sdbusplus::exception::SdBusError& e)
{
- std::stringstream ss;
- ss << "getPel exception: " << e.what();
- trace<level::INFO>(ss.str().c_str());
+ std::string traceMsg = "getPel exception: " + std::string(e.what());
+ trace<level::INFO>(traceMsg.c_str());
}
}