summaryrefslogtreecommitdiffstats
path: root/src/Common/Backends
diff options
context:
space:
mode:
authorJohannes Thorn <dante@g4t3.de>2008-09-28 00:35:16 +0200
committerJohannes Thorn <dante@g4t3.de>2008-09-28 00:35:16 +0200
commit29d723d82834a30557136f7585254eaf3673ce69 (patch)
tree2a6fa6686a709bc205036288c8f6c75cdccc050f /src/Common/Backends
parent37b452c361d99ca809c699b6968df3723f0cadb9 (diff)
downloadmad-29d723d82834a30557136f7585254eaf3673ce69.tar
mad-29d723d82834a30557136f7585254eaf3673ce69.zip
Logger gr?ndlich ?berarbeitet und den Networklogger um Timestamp erweitert.
Diffstat (limited to 'src/Common/Backends')
-rw-r--r--src/Common/Backends/ConsoleLogger.h9
-rw-r--r--src/Common/Backends/FileLogger.h9
2 files changed, 14 insertions, 4 deletions
diff --git a/src/Common/Backends/ConsoleLogger.h b/src/Common/Backends/ConsoleLogger.h
index 21b86ae..e1c8c43 100644
--- a/src/Common/Backends/ConsoleLogger.h
+++ b/src/Common/Backends/ConsoleLogger.h
@@ -21,17 +21,22 @@
#define MAD_COMMON_BACKENDS_CONSOLELOGGER_H_
#include "../Logger.h"
+#include "../RemoteLogger.h"
#include <iostream>
+#include <ctime>
namespace Mad {
namespace Common {
namespace Backends {
-class ConsoleLogger : public Logger {
+class ConsoleLogger : public Logger, public RemoteLogger {
protected:
- virtual void logMessage(MessageCategory, MessageLevel, const std::string &message) {
+ virtual void logMessage(MessageCategory, MessageLevel, time_t, const std::string &message) {
std::cerr << message << std::endl;
}
+ virtual void logMessage(MessageCategory, MessageLevel, time_t, const std::string &message, const std::string &messageSource) {
+ std::cerr << message << " from "<< messageSource << std::endl;
+ }
public:
ConsoleLogger() {}
diff --git a/src/Common/Backends/FileLogger.h b/src/Common/Backends/FileLogger.h
index 98538ee..59d2e16 100644
--- a/src/Common/Backends/FileLogger.h
+++ b/src/Common/Backends/FileLogger.h
@@ -21,20 +21,25 @@
#define MAD_COMMON_BACKENDS_FILELOGGER_H_
#include "../Logger.h"
+#include "../RemoteLogger.h"
#include <fstream>
+#include <ctime>
namespace Mad {
namespace Common {
namespace Backends {
-class FileLogger : public Logger {
+class FileLogger : public Logger, public RemoteLogger {
private:
std::ofstream file;
protected:
- virtual void logMessage(MessageCategory, MessageLevel, const std::string &message) {
+ virtual void logMessage(MessageCategory, MessageLevel, time_t, const std::string &message) {
file << message << std::endl;
}
+ virtual void logMessage(MessageCategory, MessageLevel, time_t, const std::string &message, const std::string &messageSource) {
+ file << message << " from "<< messageSource << std::endl;
+ }
public:
FileLogger(const std::string &filename)