summaryrefslogtreecommitdiffstats
path: root/src/Common/RequestHandlers
diff options
context:
space:
mode:
Diffstat (limited to 'src/Common/RequestHandlers')
-rw-r--r--src/Common/RequestHandlers/DisconnectRequestHandler.cpp5
-rw-r--r--src/Common/RequestHandlers/StatusRequestHandler.cpp5
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();