summaryrefslogtreecommitdiffstats
path: root/src/modules/FileLogger/FileLogger.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/modules/FileLogger/FileLogger.h')
-rw-r--r--src/modules/FileLogger/FileLogger.h40
1 files changed, 8 insertions, 32 deletions
diff --git a/src/modules/FileLogger/FileLogger.h b/src/modules/FileLogger/FileLogger.h
index 9b0f8e2..a24f747 100644
--- a/src/modules/FileLogger/FileLogger.h
+++ b/src/modules/FileLogger/FileLogger.h
@@ -17,31 +17,20 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-#ifndef MAD_MODULES_FILELOGGER_H_
-#define MAD_MODULES_FILELOGGER_H_
-
-#include <Core/ConfigManager.h>
-#include <Core/Configurable.h>
-#include <Core/LogManager.h>
+#ifndef MAD_MODULES_FILELOGGER_FILELOGGER_H_
+#define MAD_MODULES_FILELOGGER_FILELOGGER_H_
#include <fstream>
+#include <Core/Logger.h>
+#include <Core/RemoteLogger.h>
+
namespace Mad {
namespace Modules {
+namespace FileLogger {
class FileLogger : public Core::Logger, public Core::RemoteLogger {
private:
- class ConfigHelper : public Core::Configurable {
- protected:
- virtual bool handleConfigEntry(const Core::ConfigEntry &entry, bool handled);
-
- public:
- virtual int getPriority() const {return 1;}
- };
-
- static ConfigHelper configHelper;
- static std::set<boost::shared_ptr<FileLogger> > loggers;
-
std::ofstream file;
protected:
@@ -55,23 +44,10 @@ class FileLogger : public Core::Logger, public Core::RemoteLogger {
public:
FileLogger(const std::string &filename)
: file(filename.c_str(), std::ios::out|std::ios::app) {}
-
- static void registerConfigHelper() {
- Core::ConfigManager::get()->registerConfigurable(&configHelper);
- }
-
- static void unregisterConfigHelper() {
- Core::ConfigManager::get()->unregisterConfigurable(&configHelper);
-
- for(std::set<boost::shared_ptr<FileLogger> >::iterator logger = loggers.begin(); logger != loggers.end(); ++logger) {
- Core::LogManager::get()->unregisterLogger(boost::static_pointer_cast<Logger>(*logger));
- }
-
- loggers.clear();
- }
};
}
}
+}
-#endif /* MAD_MODULES_FILELOGGER_H_ */
+#endif /* MAD_MODULES_FILELOGGER_FILELOGGER_H_ */