diff options
Diffstat (limited to 'src/Core/RequestHandlers')
4 files changed, 9 insertions, 14 deletions
diff --git a/src/Core/RequestHandlers/DaemonListRequestHandler.cpp b/src/Core/RequestHandlers/DaemonListRequestHandler.cpp index 2bee423..2a6b119 100644 --- a/src/Core/RequestHandlers/DaemonListRequestHandler.cpp +++ b/src/Core/RequestHandlers/DaemonListRequestHandler.cpp @@ -19,19 +19,18 @@ #include "DaemonListRequestHandler.h" #include "../ConnectionManager.h" +#include <Common/Logger.h> #include <Net/Connection.h> #include <Net/Packets/ErrorPacket.h> #include <Net/Packets/NameListPacket.h> -#include <iostream> - namespace Mad { namespace Core { namespace RequestHandlers { void DaemonListRequestHandler::handlePacket(Net::Connection *connection, const Net::Packet &packet) { if(packet.getType() != Net::Packet::LIST_DAEMONS) { - std::cerr << "Received an unexpected packet." << std::endl; + Common::Logger::log(Common::Logger::ERROR, "Received an unexpected packet."); connection->send(Net::Packets::ErrorPacket(Net::Packet::ERROR, packet.getRequestId(), Common::Exception(Common::Exception::UNEXPECTED_PACKET))); signalFinished().emit(); diff --git a/src/Core/RequestHandlers/DaemonStatusRequestHandler.cpp b/src/Core/RequestHandlers/DaemonStatusRequestHandler.cpp index efdf3ea..7fcf9fe 100644 --- a/src/Core/RequestHandlers/DaemonStatusRequestHandler.cpp +++ b/src/Core/RequestHandlers/DaemonStatusRequestHandler.cpp @@ -19,12 +19,11 @@ #include "DaemonStatusRequestHandler.h" #include "../ConnectionManager.h" +#include <Common/Logger.h> #include <Core/Requests/DaemonStatusRequest.h> #include <Net/Packets/ErrorPacket.h> #include <Net/Packets/HostStatusPacket.h> -#include <iostream> - namespace Mad { namespace Core { @@ -32,7 +31,7 @@ namespace RequestHandlers { void DaemonStatusRequestHandler::handlePacket(Net::Connection *connection, const Net::Packet &packet) { if(packet.getType() != Net::Packet::DAEMON_STATUS) { - std::cerr << "Received an unexpected packet." << std::endl; + Common::Logger::log(Common::Logger::ERROR, "Received an unexpected packet."); connection->send(Net::Packets::ErrorPacket(Net::Packet::ERROR, packet.getRequestId(), Common::Exception(Common::Exception::UNEXPECTED_PACKET))); signalFinished().emit(); diff --git a/src/Core/RequestHandlers/GSSAPIAuthRequestHandler.cpp b/src/Core/RequestHandlers/GSSAPIAuthRequestHandler.cpp index d65da7e..e459511 100644 --- a/src/Core/RequestHandlers/GSSAPIAuthRequestHandler.cpp +++ b/src/Core/RequestHandlers/GSSAPIAuthRequestHandler.cpp @@ -18,13 +18,12 @@ */ #include "GSSAPIAuthRequestHandler.h" +#include <Common/Logger.h> #include <Net/Connection.h> #include <Net/Packets/ErrorPacket.h> #include <cstring> -#include <iostream> - namespace Mad { namespace Core { namespace RequestHandlers { @@ -33,7 +32,7 @@ namespace RequestHandlers { void GSSAPIAuthRequestHandler::handlePacket(Net::Connection *connection, const Net::Packet &packet) { if(packet.getType() != Net::Packet::GSSAPI_AUTH) { - std::cerr << "Received an unexpected packet." << std::endl; + Common::Logger::log(Common::Logger::ERROR, "Received an unexpected packet."); connection->send(Net::Packets::ErrorPacket(Net::Packet::ERROR, packet.getRequestId(), Common::Exception(Common::Exception::UNEXPECTED_PACKET))); signalFinished().emit(); @@ -55,7 +54,7 @@ void GSSAPIAuthRequestHandler::handlePacket(Net::Connection *connection, const N std::free(recvBuffer.value); if(majStat == GSS_S_COMPLETE) { - std::cout << "GSS context established." << std::endl; + Common::Logger::log(Common::Logger::VERBOSE, "GSS context established."); gssContinue = false; } else if(majStat != GSS_S_CONTINUE_NEEDED) { diff --git a/src/Core/RequestHandlers/IdentifyRequestHandler.cpp b/src/Core/RequestHandlers/IdentifyRequestHandler.cpp index 4e65aca..0d4f25d 100644 --- a/src/Core/RequestHandlers/IdentifyRequestHandler.cpp +++ b/src/Core/RequestHandlers/IdentifyRequestHandler.cpp @@ -19,12 +19,10 @@ #include "IdentifyRequestHandler.h" #include "../ConnectionManager.h" -#include <Common/Exception.h> +#include <Common/Logger.h> #include <Net/Connection.h> #include <Net/Packets/ErrorPacket.h> -#include <iostream> - namespace Mad { namespace Core { @@ -32,7 +30,7 @@ namespace RequestHandlers { void IdentifyRequestHandler::handlePacket(Net::Connection *connection, const Net::Packet &packet) { if(packet.getType() != Net::Packet::IDENTIFY) { - std::cerr << "Received an unexpected packet." << std::endl; + Common::Logger::log(Common::Logger::ERROR, "Received an unexpected packet."); connection->send(Net::Packets::ErrorPacket(Net::Packet::ERROR, packet.getRequestId(), Common::Exception(Common::Exception::UNEXPECTED_PACKET))); signalFinished().emit(); |