diff --git a/libsrc/grabber/amlogic/AmlogicWrapper.cpp b/libsrc/grabber/amlogic/AmlogicWrapper.cpp index 3a9a97c1..2506d79b 100644 --- a/libsrc/grabber/amlogic/AmlogicWrapper.cpp +++ b/libsrc/grabber/amlogic/AmlogicWrapper.cpp @@ -1,5 +1,4 @@ // QT includes -#include #include // Hyperion includes diff --git a/libsrc/grabber/dispmanx/DispmanxWrapper.cpp b/libsrc/grabber/dispmanx/DispmanxWrapper.cpp index 7167cbd3..cec8ee65 100644 --- a/libsrc/grabber/dispmanx/DispmanxWrapper.cpp +++ b/libsrc/grabber/dispmanx/DispmanxWrapper.cpp @@ -1,5 +1,4 @@ // QT includes -#include #include // Hyperion includes diff --git a/libsrc/protoserver/ProtoConnection.cpp b/libsrc/protoserver/ProtoConnection.cpp index 3ac7ce77..d9e8d0c0 100644 --- a/libsrc/protoserver/ProtoConnection.cpp +++ b/libsrc/protoserver/ProtoConnection.cpp @@ -164,7 +164,7 @@ void ProtoConnection::sendMessage(const proto::HyperionRequest &message) break; default: - //std::cout << "Connecting to Hyperion: " << _host.toStdString() << ":" << _port << std::endl; + Debug(_log, "Connecting to Hyperion: %s:%d", _host.toStdString().c_str(), _port); break; } _prevSocketState = _socket.state(); diff --git a/libsrc/webconfig/CgiHandler.cpp b/libsrc/webconfig/CgiHandler.cpp index 9d606080..90341027 100644 --- a/libsrc/webconfig/CgiHandler.cpp +++ b/libsrc/webconfig/CgiHandler.cpp @@ -23,8 +23,6 @@ void CgiHandler::exec(const QStringList & args, QtHttpRequest * request, QtHttpR { // QByteArray header = reply->getHeader(QtHttpHeader::Host); // QtHttpRequest::ClientInfo info = request->getClientInfo(); -// qDebug() << info.clientAddress.toString(); -// qDebug() << info.serverAddress.toString(); cmd_cfg_jsonserver(args,reply); cmd_cfg_hyperion(args,reply); diff --git a/libsrc/webconfig/QtHttpClientWrapper.cpp b/libsrc/webconfig/QtHttpClientWrapper.cpp index 4464ff5f..eb8cff5c 100644 --- a/libsrc/webconfig/QtHttpClientWrapper.cpp +++ b/libsrc/webconfig/QtHttpClientWrapper.cpp @@ -50,10 +50,6 @@ void QtHttpClientWrapper::onClientDataReceived (void) { QString url = parts.at (1); QString version = parts.at (2); if (version == QtHttpServer::HTTP_VERSION) { - //qDebug () << "Debug : HTTP" - // << "command :" << command - // << "url :" << url - // << "version :" << version; m_currentRequest = new QtHttpRequest (m_serverHandle); m_currentRequest->setClientInfo(m_sockClient->localAddress(), m_sockClient->peerAddress()); m_currentRequest->setUrl (QUrl (url)); @@ -78,9 +74,6 @@ void QtHttpClientWrapper::onClientDataReceived (void) { if (pos > 0) { QByteArray header = raw.left (pos).trimmed (); QByteArray value = raw.mid (pos +1).trimmed (); - //qDebug () << "Debug : HTTP" - // << "header :" << header - // << "value :" << value; m_currentRequest->addHeader (header, value); if (header == QtHttpHeader::ContentLength) { int len = -1; @@ -97,7 +90,6 @@ void QtHttpClientWrapper::onClientDataReceived (void) { } } else { // end of headers - //qDebug () << "Debug : HTTP end of headers"; if (m_currentRequest->getHeader (QtHttpHeader::ContentLength).toInt () > 0) { m_parsingStatus = AwaitingContent; } @@ -109,11 +101,7 @@ void QtHttpClientWrapper::onClientDataReceived (void) { } case AwaitingContent: { // raw data × N (until EOF ??) m_currentRequest->appendRawData (line); - //qDebug () << "Debug : HTTP" - // << "content :" << m_currentRequest->getRawData ().toHex () - // << "size :" << m_currentRequest->getRawData ().size (); if (m_currentRequest->getRawDataSize () == m_currentRequest->getHeader (QtHttpHeader::ContentLength).toInt ()) { - //qDebug () << "Debug : HTTP end of content"; m_parsingStatus = RequestParsed; } break; diff --git a/libsrc/webconfig/QtHttpServer.cpp b/libsrc/webconfig/QtHttpServer.cpp index cf0ff33f..5b465cbc 100644 --- a/libsrc/webconfig/QtHttpServer.cpp +++ b/libsrc/webconfig/QtHttpServer.cpp @@ -7,7 +7,6 @@ #include #include #include -#include const QString & QtHttpServer::HTTP_VERSION = QStringLiteral ("HTTP/1.1"); diff --git a/libsrc/webconfig/StaticFileServing.cpp b/libsrc/webconfig/StaticFileServing.cpp index 2035a8e3..25e5f9a4 100644 --- a/libsrc/webconfig/StaticFileServing.cpp +++ b/libsrc/webconfig/StaticFileServing.cpp @@ -3,7 +3,6 @@ #include #include -#include #include #include #include @@ -13,6 +12,7 @@ StaticFileServing::StaticFileServing (Hyperion *hyperion, QString baseUrl, quint , _hyperion(hyperion) , _baseUrl (baseUrl) , _cgi(hyperion, this) + , _log(Logger::getInstance("WEBSERVER")) { _mimeDb = new QMimeDatabase; @@ -34,16 +34,16 @@ StaticFileServing::~StaticFileServing () void StaticFileServing::onServerStarted (quint16 port) { - qDebug () << "QtHttpServer started on port" << port << _server->getServerName (); + Info(_log, "started on port %d name \"%s\"", port ,_server->getServerName().toStdString().c_str()); } void StaticFileServing::onServerStopped () { - qDebug () << "QtHttpServer stopped" << _server->getServerName (); + Info(_log, "stopped %s", _server->getServerName().toStdString().c_str()); } void StaticFileServing::onServerError (QString msg) { - qDebug () << "QtHttpServer error :" << msg; + Error(_log, "%s", msg.toStdString().c_str()); } static inline void printErrorToReply (QtHttpReply * reply, QString errorMessage) diff --git a/libsrc/webconfig/StaticFileServing.h b/libsrc/webconfig/StaticFileServing.h index 51303894..d0a3bcd2 100644 --- a/libsrc/webconfig/StaticFileServing.h +++ b/libsrc/webconfig/StaticFileServing.h @@ -11,6 +11,8 @@ #include "CgiHandler.h" #include +#include + class StaticFileServing : public QObject { Q_OBJECT @@ -31,6 +33,8 @@ private: QtHttpServer * _server; QMimeDatabase * _mimeDb; CgiHandler _cgi; + Logger * _log; + }; #endif // STATICFILESERVING_H