diff options
Diffstat (limited to 'src/mad.cpp')
-rw-r--r-- | src/mad.cpp | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/src/mad.cpp b/src/mad.cpp index b2f8b61..0985bb0 100644 --- a/src/mad.cpp +++ b/src/mad.cpp @@ -20,20 +20,24 @@ #include "Net/ClientConnection.h" #include "Net/IPAddress.h" #include "Common/Backends/SystemBackendProc.h" +#include "Common/Logger.h" +#include "Common/Backends/ConsoleLogger.h" #include "Common/Request.h" #include "Common/RequestManager.h" #include "Common/RequestHandlers/StatusRequestHandler.h" #include "Daemon/Requests/IdentifyRequest.h" -#include <iostream> #include <unistd.h> void requestFinished(const Mad::Common::Request<>&) { - std::cerr << "Identified." << std::endl; + Mad::Common::Logger::log("Identified."); } int main() { + Mad::Common::Backends::ConsoleLogger logger; + Mad::Common::Logger::registerLogger(&logger); + Mad::Net::Connection::init(); Mad::Common::RequestManager::init(false); @@ -70,7 +74,7 @@ int main() { Mad::Common::RequestManager::getRequestManager()->unregisterConnection(connection); } catch(Mad::Net::Exception &e) { - std::cerr << "Connection error: " << e.what() << std::endl; + Mad::Common::Logger::log(Mad::Common::Logger::CRITICAL, "Connection error: " + e.what()); } delete connection; |