summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJohannes Thorn <dante@g4t3.de>2008-09-24 22:35:41 +0200
committerJohannes Thorn <dante@g4t3.de>2008-09-24 22:35:41 +0200
commita39c7b60031f7479c9f7d27e7c69407be6fe49d0 (patch)
tree1a7c0607d502d25dc68d5ad3aed31a1f432dfd8c /src
parent4af89ed7f5d5b830332c796f7038600ad01ec3f5 (diff)
downloadmad-a39c7b60031f7479c9f7d27e7c69407be6fe49d0.tar
mad-a39c7b60031f7479c9f7d27e7c69407be6fe49d0.zip
Levelloses Loggen mit Kategorie hinzugef?gt.
Diffstat (limited to 'src')
-rw-r--r--src/Common/Logger.cpp11
-rw-r--r--src/Common/Logger.h4
2 files changed, 11 insertions, 4 deletions
diff --git a/src/Common/Logger.cpp b/src/Common/Logger.cpp
index 859a77d..f87d41b 100644
--- a/src/Common/Logger.cpp
+++ b/src/Common/Logger.cpp
@@ -55,7 +55,6 @@ void Logger::logfv(MessageCategory category, MessageLevel level, const char *for
}
void Logger::log(MessageCategory category, MessageLevel level, const std::string &message) {
- //TODO Category
for(std::list<Logger*>::iterator logger = loggers.begin(); logger != loggers.end(); ++logger) {
if((*logger)->getLevel() >= level && (*logger)->isCategorySet(category))
(*logger)->logMessage(category, level, message);
@@ -64,15 +63,20 @@ void Logger::log(MessageCategory category, MessageLevel level, const std::string
void Logger::logf(MessageCategory category, MessageLevel level, const char *format, ...) {
va_list ap;
-
va_start(ap, format);
logfv(category, level, format, ap);
va_end(ap);
}
-void Logger::logf(MessageLevel level, const char *format, ...) {
+void Logger::logf(MessageCategory category, const char *format, ...) {
va_list ap;
+ va_start(ap, format);
+ logfv(category, DEFAULT, format, ap);
+ va_end(ap);
+}
+void Logger::logf(MessageLevel level, const char *format, ...) {
+ va_list ap;
va_start(ap, format);
logfv(GENERAL, level, format, ap);
va_end(ap);
@@ -80,7 +84,6 @@ void Logger::logf(MessageLevel level, const char *format, ...) {
void Logger::logf(const char *format, ...) {
va_list ap;
-
va_start(ap, format);
logfv(GENERAL, DEFAULT, format, ap);
va_end(ap);
diff --git a/src/Common/Logger.h b/src/Common/Logger.h
index 64aeadb..4b25dd0 100644
--- a/src/Common/Logger.h
+++ b/src/Common/Logger.h
@@ -52,6 +52,9 @@ class Logger {
public:
static void log(MessageCategory category, MessageLevel level, const std::string &message);
+ static void log(MessageCategory category, const std::string &message) {
+ log(category, DEFAULT, message);
+ }
static void log(MessageLevel level, const std::string &message) {
log(GENERAL, level, message);
}
@@ -60,6 +63,7 @@ class Logger {
}
static void logf(MessageCategory category, MessageLevel level, const char *format, ...);
+ static void logf(MessageCategory category, const char *format, ...);
static void logf(MessageLevel level, const char *format, ...);
static void logf(const char *format, ...);