summaryrefslogtreecommitdiffstats
path: root/src/Core/RequestHandlers
diff options
context:
space:
mode:
authorMatthias Schiffer <matthias@gamezock.de>2008-09-29 22:58:39 +0200
committerMatthias Schiffer <matthias@gamezock.de>2008-09-29 22:58:39 +0200
commit4f8c2ba997d4f89b392a3b0683773a71d21a4f80 (patch)
tree5e42e5a3a2f4c1437acf20ddcaf3c50b8c61990e /src/Core/RequestHandlers
parentd90eb49281efcf2db039fbaacccebd4acdc15f7f (diff)
downloadmad-4f8c2ba997d4f89b392a3b0683773a71d21a4f80.tar
mad-4f8c2ba997d4f89b392a3b0683773a71d21a4f80.zip
Abfrage des Quell-Daemon-Namens eines Requests m?glich f?r RemoteLogger
Diffstat (limited to 'src/Core/RequestHandlers')
-rw-r--r--src/Core/RequestHandlers/LogRequestHandler.cpp10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/Core/RequestHandlers/LogRequestHandler.cpp b/src/Core/RequestHandlers/LogRequestHandler.cpp
index 5640159..6bda627 100644
--- a/src/Core/RequestHandlers/LogRequestHandler.cpp
+++ b/src/Core/RequestHandlers/LogRequestHandler.cpp
@@ -20,6 +20,7 @@
#include "LogRequestHandler.h"
#include <Common/Logger.h>
#include <Common/RemoteLogger.h>
+#include "../ConnectionManager.h"
#include <Net/Connection.h>
#include <Net/Packets/ErrorPacket.h>
#include <Net/Packets/LogPacket.h>
@@ -40,7 +41,14 @@ void LogRequestHandler::handlePacket(Net::Connection *connection, const Net::Pac
// TODO Require authentication
Net::Packets::LogPacket logPacket(packet);
- Common::RemoteLogger::log(logPacket.getCategory(), logPacket.getLevel(), logPacket.getTimestamp(), logPacket.getMessage().c_str(), std::string());
+
+ try {
+ Common::RemoteLogger::log(logPacket.getCategory(), logPacket.getLevel(), logPacket.getTimestamp(), logPacket.getMessage().c_str(),
+ ConnectionManager::getConnectionManager()->getDaemonName(connection));
+ }
+ catch(Common::Exception &e) {
+ Common::Logger::logf(Common::Logger::ERROR, "Can't determine daemon name: %s", e.strerror().c_str());
+ }
connection->send(Net::Packet(Net::Packet::OK, packet.getRequestId()));