nb: logging

Change-Id: Ia67f746a6c71b4753d04b92472eddf1614c0d337
This commit is contained in:
Ashod Nakashian 2017-02-27 21:35:06 -05:00 committed by Jan Holesovsky
parent 57235943c0
commit 72669bf929
3 changed files with 9 additions and 6 deletions

View file

@ -426,8 +426,8 @@ protected:
auto& log = Log::logger();
if (log.trace()) {
LOG_TRC("Incoming data buffer " << _inBuffer.size() <<
" closeSocket? " << _closed);
LOG_TRC("#" << getFD() << ": Incoming data buffer " << _inBuffer.size() <<
" bytes, closeSocket? " << closed);
log.dump("", &_inBuffer[0], _inBuffer.size());
}
@ -507,12 +507,12 @@ protected:
if (log.trace()) {
if (len > 0)
{
LOG_TRC("Wrote outgoing data " << len << " bytes");
LOG_TRC("#" << getFD() << ": Wrote outgoing data " << len << " bytes");
log.dump("", &_outBuffer[0], len);
}
else
{
LOG_SYS("Wrote outgoing data " << len << " bytes");
LOG_SYS("#" << getFD() << ": Wrote outgoing data " << len << " bytes");
}
}
}
@ -569,7 +569,10 @@ namespace HttpHelper
{
struct stat st;
if (stat(path.c_str(), &st) != 0)
{
LOG_WRN("Failed to stat [" << path << "]. File will not be sent.");
return;
}
std::ostringstream oss;
oss << "HTTP/1.1 200 OK\r\n"

View file

@ -307,7 +307,7 @@ void FileServerRequestHandler::preprocessFile(const HTTPRequest& request, const
<< preprocess;
socket->send(oss.str());
LOG_DBG("Sent file: " << path.toString());
LOG_DBG("Sent file: " << path.toString() << ": " << preprocess);
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */

View file

@ -2795,7 +2795,7 @@ private:
auto socket = _socket.lock();
socket->send(oss.str());
socket->shutdown();
LOG_INF("Sent discovery.xml successfully.");
LOG_INF("Sent / response successfully.");
}
void handleFaviconRequest(const Poco::Net::HTTPRequest& request)