summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMatthias Schiffer <matthias@gamezock.de>2008-09-24 23:51:22 +0200
committerMatthias Schiffer <matthias@gamezock.de>2008-09-24 23:51:22 +0200
commit3a8e13c8ef66a4fdb06b2051bd7ab95ca24cc81c (patch)
tree4feb7da206e27ebbf9fefdb93b7d2499d61c7273 /src
parent0bf9d3cac0ab1f6c53001dafbd1e217fc5973be9 (diff)
parent202f55574f2f3f22f884a3ee7969194202f58deb (diff)
downloadmad-3a8e13c8ef66a4fdb06b2051bd7ab95ca24cc81c.tar
mad-3a8e13c8ef66a4fdb06b2051bd7ab95ca24cc81c.zip
Merge heads
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 56abd61..593fd7a 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, ...);