diff options
author | Matthias Schiffer <matthias@gamezock.de> | 2008-11-17 08:25:02 +0100 |
---|---|---|
committer | Matthias Schiffer <matthias@gamezock.de> | 2008-11-17 08:25:02 +0100 |
commit | 62ca019532b28527facf6ab133742c2a190f15d6 (patch) | |
tree | 2b02963ed8a8a0d21dbe42885c2e284d3c60620c /src/Common | |
parent | 2b83ae7c71dc706fb4fd7b4efc4a8ffee8dfe522 (diff) | |
download | mad-62ca019532b28527facf6ab133742c2a190f15d6.tar mad-62ca019532b28527facf6ab133742c2a190f15d6.zip |
Configurable von Initializable ableiten; InformationManager ist jetzt auch ein Initializable
Diffstat (limited to 'src/Common')
-rw-r--r-- | src/Common/Configurable.h | 4 | ||||
-rw-r--r-- | src/Common/LogManager.cpp | 8 | ||||
-rw-r--r-- | src/Common/LogManager.h | 2 |
3 files changed, 12 insertions, 2 deletions
diff --git a/src/Common/Configurable.h b/src/Common/Configurable.h index 47f919d..90641a0 100644 --- a/src/Common/Configurable.h +++ b/src/Common/Configurable.h @@ -20,13 +20,15 @@ #ifndef MAD_COMMON_CONFIGURABLE_H_ #define MAD_COMMON_CONFIGURABLE_H_ +#include "Initializable.h" + namespace Mad { namespace Common { class ConfigEntry; class ConfigManager; -class Configurable { +class Configurable : virtual public Initializable { public: virtual ~Configurable() {} diff --git a/src/Common/LogManager.cpp b/src/Common/LogManager.cpp index 7b4e898..d974d7c 100644 --- a/src/Common/LogManager.cpp +++ b/src/Common/LogManager.cpp @@ -69,6 +69,14 @@ void LogManager::configFinished() { log(message.category, message.level, message.timestamp, message.message); queue->pop(); } + + std::auto_ptr<std::queue<RemoteMessage> > queue2 = remoteMessageQueue; + + while(!queue2->empty()) { + const RemoteMessage &message = queue2->front(); + log(message.category, message.level, message.timestamp, message.message, message.source); + queue2->pop(); + } } void LogManager::log(MessageCategory category, MessageLevel level, time_t timestamp, const std::string &message) { diff --git a/src/Common/LogManager.h b/src/Common/LogManager.h index c1bba9f..846bc95 100644 --- a/src/Common/LogManager.h +++ b/src/Common/LogManager.h @@ -33,7 +33,7 @@ namespace Mad { namespace Common { -class LogManager : public Initializable, public Configurable { +class LogManager : public Configurable { private: typedef LoggerBase::MessageCategory MessageCategory; typedef LoggerBase::MessageLevel MessageLevel; |