From 4f8c2ba997d4f89b392a3b0683773a71d21a4f80 Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Mon, 29 Sep 2008 22:58:39 +0200 Subject: Abfrage des Quell-Daemon-Namens eines Requests m?glich f?r RemoteLogger --- src/Core/RequestHandlers/LogRequestHandler.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'src/Core/RequestHandlers') 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 #include +#include "../ConnectionManager.h" #include #include #include @@ -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())); -- cgit v1.2.3