summaryrefslogtreecommitdiffstats
path: root/src/Common/Backends
diff options
context:
space:
mode:
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)