diff options
author | Matthias Schiffer <matthias@gamezock.de> | 2008-09-17 22:18:09 +0200 |
---|---|---|
committer | Matthias Schiffer <matthias@gamezock.de> | 2008-09-17 22:18:09 +0200 |
commit | d84a3b91346038bf55d7111462dab42a0a26445d (patch) | |
tree | 1e9eca4eba2a8da8f616815e56385725310fe148 /src/Common/RequestHandlers | |
parent | cccc512e2565b7b96b765bfb873f0fb635bd23e1 (diff) | |
download | mad-d84a3b91346038bf55d7111462dab42a0a26445d.tar mad-d84a3b91346038bf55d7111462dab42a0a26445d.zip |
Logger f?r Log-Messages benutzen
Diffstat (limited to 'src/Common/RequestHandlers')
-rw-r--r-- | src/Common/RequestHandlers/DisconnectRequestHandler.cpp | 5 | ||||
-rw-r--r-- | src/Common/RequestHandlers/StatusRequestHandler.cpp | 5 |
2 files changed, 4 insertions, 6 deletions
diff --git a/src/Common/RequestHandlers/DisconnectRequestHandler.cpp b/src/Common/RequestHandlers/DisconnectRequestHandler.cpp index 010f1e7..6a5ca99 100644 --- a/src/Common/RequestHandlers/DisconnectRequestHandler.cpp +++ b/src/Common/RequestHandlers/DisconnectRequestHandler.cpp @@ -18,18 +18,17 @@ */ #include "DisconnectRequestHandler.h" +#include "../Logger.h" #include <Net/Connection.h> #include <Net/Packets/ErrorPacket.h> -#include <iostream> - namespace Mad { namespace Common { namespace RequestHandlers { void DisconnectRequestHandler::handlePacket(Net::Connection *connection, const Net::Packet &packet) { if(packet.getType() != Net::Packet::DISCONNECT) { - std::cerr << "Received an unexpected packet." << std::endl; + Logger::log(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/Common/RequestHandlers/StatusRequestHandler.cpp b/src/Common/RequestHandlers/StatusRequestHandler.cpp index bcff6b6..a3f8675 100644 --- a/src/Common/RequestHandlers/StatusRequestHandler.cpp +++ b/src/Common/RequestHandlers/StatusRequestHandler.cpp @@ -19,19 +19,18 @@ #include "StatusRequestHandler.h" #include "../SystemBackend.h" +#include "../Logger.h" #include <Net/Connection.h> #include <Net/Packets/ErrorPacket.h> #include <Net/Packets/HostStatusPacket.h> -#include <iostream> - namespace Mad { namespace Common { namespace RequestHandlers { void StatusRequestHandler::handlePacket(Net::Connection *connection, const Net::Packet &packet) { if(packet.getType() != Net::Packet::STATUS) { - std::cerr << "Received an unexpected packet." << std::endl; + Logger::log(Logger::ERROR, "Received an unexpected packet."); connection->send(Net::Packets::ErrorPacket(Net::Packet::ERROR, packet.getRequestId(), Common::Exception(Common::Exception::UNEXPECTED_PACKET))); signalFinished().emit(); |