summaryrefslogtreecommitdiffstats
path: root/src/Common
diff options
context:
space:
mode:
Diffstat (limited to 'src/Common')
-rw-r--r--src/Common/Backends/ConsoleLogger.cpp2
-rw-r--r--src/Common/Backends/ConsoleLogger.h2
-rw-r--r--src/Common/Backends/FileLogger.cpp2
-rw-r--r--src/Common/Backends/FileLogger.h2
-rw-r--r--src/Common/Backends/SystemBackendProc.cpp2
-rw-r--r--src/Common/RequestHandlers/DisconnectRequestHandler.cpp5
-rw-r--r--src/Common/RequestHandlers/StatusRequestHandler.cpp5
-rw-r--r--src/Common/RequestManager.cpp6
-rw-r--r--src/Common/Requests/GSSAPIAuthRequest.cpp9
9 files changed, 15 insertions, 20 deletions
diff --git a/src/Common/Backends/ConsoleLogger.cpp b/src/Common/Backends/ConsoleLogger.cpp
index 180a009..4bfa93b 100644
--- a/src/Common/Backends/ConsoleLogger.cpp
+++ b/src/Common/Backends/ConsoleLogger.cpp
@@ -24,7 +24,7 @@ namespace Mad {
namespace Common {
namespace Backends {
-void ConsoleLogger::logMessage(MessageLevel level, const std::string &message) {
+void ConsoleLogger::logMessage(MessageLevel, const std::string &message) {
std::cerr << message << std::endl;
}
diff --git a/src/Common/Backends/ConsoleLogger.h b/src/Common/Backends/ConsoleLogger.h
index f55d7ba..72fc179 100644
--- a/src/Common/Backends/ConsoleLogger.h
+++ b/src/Common/Backends/ConsoleLogger.h
@@ -28,7 +28,7 @@ namespace Backends {
class ConsoleLogger : public Logger {
protected:
- virtual void logMessage(MessageLevel level, const std::string &message);
+ virtual void logMessage(MessageLevel, const std::string &message);
public:
ConsoleLogger() {}
diff --git a/src/Common/Backends/FileLogger.cpp b/src/Common/Backends/FileLogger.cpp
index 079c08c..b0bd57b 100644
--- a/src/Common/Backends/FileLogger.cpp
+++ b/src/Common/Backends/FileLogger.cpp
@@ -23,7 +23,7 @@ namespace Mad {
namespace Common {
namespace Backends {
-void FileLogger::logMessage(MessageLevel level, const std::string &message) {
+void FileLogger::logMessage(MessageLevel, const std::string &message) {
file << message << std::endl;
}
diff --git a/src/Common/Backends/FileLogger.h b/src/Common/Backends/FileLogger.h
index 219a464..8a72bec 100644
--- a/src/Common/Backends/FileLogger.h
+++ b/src/Common/Backends/FileLogger.h
@@ -32,7 +32,7 @@ class FileLogger : public Logger {
std::ofstream file;
protected:
- virtual void logMessage(MessageLevel level, const std::string &message);
+ virtual void logMessage(MessageLevel, const std::string &message);
public:
FileLogger(const std::string &filename)
diff --git a/src/Common/Backends/SystemBackendProc.cpp b/src/Common/Backends/SystemBackendProc.cpp
index 7e9fcbd..3a3f283 100644
--- a/src/Common/Backends/SystemBackendProc.cpp
+++ b/src/Common/Backends/SystemBackendProc.cpp
@@ -22,8 +22,6 @@
#include <fstream>
#include <pcrecpp.h>
-#include <iostream>
-
namespace Mad {
namespace Common {
namespace Backends {
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();
diff --git a/src/Common/RequestManager.cpp b/src/Common/RequestManager.cpp
index 2bf82b0..afe72b0 100644
--- a/src/Common/RequestManager.cpp
+++ b/src/Common/RequestManager.cpp
@@ -20,12 +20,12 @@
#include "RequestManager.h"
#include "Request.h"
#include "RequestHandlers/DisconnectRequestHandler.h"
+#include "Logger.h"
#include <Net/Packets/ErrorPacket.h>
#include <sigc++/bind.h>
#include <sigc++/retype_return.h>
-#include <iostream>
namespace Mad {
namespace Common {
@@ -72,7 +72,7 @@ void RequestManager::receiveHandler(Net::Connection *connection, const Net::Pack
if(it == requestMaps.end()) {
// TODO: Error
- std::cerr << "Received a packet from an unregistered connection." << std::endl;
+ Logger::log(Logger::ERROR, "Received a packet from an unregistered connection.");
return;
}
@@ -95,7 +95,7 @@ void RequestManager::receiveHandler(Net::Connection *connection, const Net::Pack
return;
}
- 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(), Exception(Exception::UNEXPECTED_PACKET)));
}
diff --git a/src/Common/Requests/GSSAPIAuthRequest.cpp b/src/Common/Requests/GSSAPIAuthRequest.cpp
index 53d969f..05fb373 100644
--- a/src/Common/Requests/GSSAPIAuthRequest.cpp
+++ b/src/Common/Requests/GSSAPIAuthRequest.cpp
@@ -18,12 +18,11 @@
*/
#include "GSSAPIAuthRequest.h"
+#include "../Logger.h"
#include <Net/Connection.h>
#include <cstring>
-#include <iostream>
-
namespace Mad {
namespace Common {
namespace Requests {
@@ -58,7 +57,7 @@ void GSSAPIAuthRequest::sendRequest(Net::Connection *connection, uint16_t reques
0, GSS_C_NO_CHANNEL_BINDINGS, GSS_C_NO_BUFFER, 0, &buffer, 0, 0);
if(majStat == GSS_S_COMPLETE) {
- std::cout << "GSS context established." << std::endl;
+ Logger::log(Logger::VERBOSE, "GSS context established.");
gssContinue = false;
}
else if(majStat != GSS_S_CONTINUE_NEEDED) {
@@ -96,7 +95,7 @@ void GSSAPIAuthRequest::handlePacket(Net::Connection *connection, const Net::Pac
std::free(recvBuffer.value);
if(majStat == GSS_S_COMPLETE) {
- std::cout << "GSS context established." << std::endl;
+ Logger::log(Logger::VERBOSE, "GSS context established.");
gssContinue = false;
}
else if(majStat != GSS_S_CONTINUE_NEEDED) {
@@ -129,7 +128,7 @@ void GSSAPIAuthRequest::handlePacket(Net::Connection *connection, const Net::Pac
return;
connection->setAuthenticated();
- std::cout << "Authentication complete." << std::endl;
+ Logger::log(Logger::VERBOSE, "Authentication complete.");
majStat = gss_delete_sec_context(&minStat, &gssContext, &sendBuffer);