Reduced excessive logging to the journal.
Fixes openbmc/openbmc#983
Change-Id: If52055feca8f965162948bd7af710da3ea9257d2
Signed-off-by: Ratan Gupta <ratagupt@in.ibm.com>
diff --git a/main.cpp b/main.cpp
index 13da385..4e1dbe8 100644
--- a/main.cpp
+++ b/main.cpp
@@ -22,7 +22,7 @@
if (rc < 0)
{
- std::cerr << "E> SLP Error in Read : " << std::hex << rc << "\n";
+ std::cerr << "SLP Error in Read : " << std::hex << rc << "\n";
return rc;
}
@@ -30,15 +30,6 @@
{
case slp::VERSION_2:
{
- std::cout << "SLP Request" << "\n";
- //print the buffer
- std::for_each(recvBuff.begin(), recvBuff.end(),
- [](uint8_t & ch)
- {
- std::cout << std::hex << std::setfill('0')
- << std::setw(2) << (int)ch << ' ' ;
- });
- std::cout << "\n";
//Parse the buffer and construct the req object
std::tie(rc, req) = slp::parser::parseBuffer(recvBuff);
if (!rc)
@@ -49,6 +40,9 @@
break;
}
default:
+ std::cout << "SLP Unsupported Request Version="
+ << (int)recvBuff[0] <<"\n";
+
rc = static_cast<uint8_t>(slp::Error::VER_NOT_SUPPORTED);
break;
}
@@ -57,19 +51,10 @@
//or processing of request then handle the error.
if (rc)
{
- std::cerr << "E> SLP Error rc=" << rc << "\n";
+ std::cerr << "SLP Error rc=" << rc << "\n";
resp = slp::handler::processError(req, rc);
}
- //print and send the response
- std::cout << "SLP Response" << "\n";
- std::for_each(resp.begin(), resp.end(),
- [](uint8_t & ch)
- {
- std::cout << std::hex << std::setfill('0')
- << std::setw(2) << (int)ch << ' ' ;
- });
-
channel.write(resp);
return slp::SUCCESS;
}
diff --git a/slp_message_handler.cpp b/slp_message_handler.cpp
index 5fd3e38..14ed15f 100644
--- a/slp_message_handler.cpp
+++ b/slp_message_handler.cpp
@@ -90,6 +90,7 @@
if (svcList.size() <= 0)
{
buff.resize(0);
+ std::cerr << "SLP unable to read the service info\n";
return std::make_tuple((int)slp::Error::INTERNAL_ERROR, buff);
}
@@ -181,6 +182,7 @@
if (svcList.size() <= 0)
{
buff.resize(0);
+ std::cerr << "SLP unable to read the service info\n";
return std::make_tuple((int)slp::Error::INTERNAL_ERROR, buff);
}
@@ -190,6 +192,7 @@
if (svcIt == svcList.end())
{
buff.resize(0);
+ std::cerr << "SLP unable to find the service=" << svcName << "\n";
return std::make_tuple((int)slp::Error::INTERNAL_ERROR, buff);
}
//Get all the interface address
@@ -197,6 +200,7 @@
if (ifaddrList.size() <= 0)
{
buff.resize(0);
+ std::cerr << "SLP unable to read the interface address\n";
return std::make_tuple((int)slp::Error::INTERNAL_ERROR, buff);
}
@@ -363,6 +367,9 @@
buffer resp(0);
switch (msg.header.functionID)
{
+ std::cout << "SLP Processing Request="
+ << msg.header.functionID <<"\n";
+
case (uint8_t)slp::FunctionType::SRVTYPERQST:
std::tie(rc, resp) = slp::handler::internal::processSrvTypeRequest(msg);
break;