summaryrefslogtreecommitdiffstats
path: root/src/Daemon
diff options
context:
space:
mode:
authorMatthias Schiffer <matthias@gamezock.de>2009-08-31 21:21:09 +0200
committerMatthias Schiffer <matthias@gamezock.de>2009-08-31 21:21:09 +0200
commit7890312d0a850ffc5be20d078d7e8f2d148dca3e (patch)
treea466ac9d3d0a8ecde06fa5c03b154480361cfdf5 /src/Daemon
parent053843f893dd5c96a88e285cf2a5b35419f7dfca (diff)
downloadmad-7890312d0a850ffc5be20d078d7e8f2d148dca3e.tar
mad-7890312d0a850ffc5be20d078d7e8f2d148dca3e.zip
LogManager überarbeitet
Diffstat (limited to 'src/Daemon')
-rw-r--r--src/Daemon/Backends/NetworkLogger.h4
-rw-r--r--src/Daemon/Requests/LogRequest.cpp1
-rw-r--r--src/Daemon/Requests/LogRequest.h11
3 files changed, 9 insertions, 7 deletions
diff --git a/src/Daemon/Backends/NetworkLogger.h b/src/Daemon/Backends/NetworkLogger.h
index 9965468..8c93036 100644
--- a/src/Daemon/Backends/NetworkLogger.h
+++ b/src/Daemon/Backends/NetworkLogger.h
@@ -35,8 +35,8 @@ class NetworkLogger : public Core::Logger {
Common::Connection *connection;
protected:
- virtual void logMessage(Core::Logger::MessageCategory category, Core::Logger::MessageLevel level, boost::posix_time::ptime messageTimestamp, const std::string &message) {
- boost::shared_ptr<Requests::LogRequest> request(new Requests::LogRequest(application, category, level, messageTimestamp, message));
+ virtual void logMessage(Core::Logger::MessageCategory category, Core::Logger::MessageLevel level, boost::posix_time::ptime messageTimestamp, const std::string &message, const std::string &source) {
+ boost::shared_ptr<Requests::LogRequest> request(new Requests::LogRequest(application, category, level, messageTimestamp, message, source));
application->getRequestManager()->sendRequest(connection, request);
}
diff --git a/src/Daemon/Requests/LogRequest.cpp b/src/Daemon/Requests/LogRequest.cpp
index 2d12fc8..9266420 100644
--- a/src/Daemon/Requests/LogRequest.cpp
+++ b/src/Daemon/Requests/LogRequest.cpp
@@ -34,6 +34,7 @@ void LogRequest::sendRequest() {
packet.set("level", level);
packet.set("timestamp", boost::posix_time::to_iso_string(messageTimestamp));
packet.set("message", message);
+ packet.set("source", source);
sendPacket(packet);
}
diff --git a/src/Daemon/Requests/LogRequest.h b/src/Daemon/Requests/LogRequest.h
index 49d5c6f..2d8c91f 100644
--- a/src/Daemon/Requests/LogRequest.h
+++ b/src/Daemon/Requests/LogRequest.h
@@ -31,17 +31,18 @@ namespace Requests {
class MAD_DAEMON_EXPORT LogRequest : public Common::Request {
private:
- Core::LoggerBase::MessageCategory category;
- Core::LoggerBase::MessageLevel level;
+ Core::Logger::MessageCategory category;
+ Core::Logger::MessageLevel level;
boost::posix_time::ptime messageTimestamp;
- std::string message;
+ std::string message, source;
protected:
virtual void sendRequest();
public:
- LogRequest(Common::Application *application, Core::LoggerBase::MessageCategory category0, Core::LoggerBase::MessageLevel level0, boost::posix_time::ptime messageTimestamp0, const std::string &message0)
- : Common::Request(application), category(category0), level(level0), messageTimestamp(messageTimestamp0), message(message0) {}
+ LogRequest(Common::Application *application, Core::Logger::MessageCategory category0, Core::Logger::MessageLevel level0, boost::posix_time::ptime messageTimestamp0, const std::string &message0,
+ const std::string &source0)
+ : Common::Request(application), category(category0), level(level0), messageTimestamp(messageTimestamp0), message(message0), source(source0) {}
};
}