diff options
author | dante@ares.olymp <dante@ares.olymp> | 2008-09-24 22:40:36 +0200 |
---|---|---|
committer | dante@ares.olymp <dante@ares.olymp> | 2008-09-24 22:40:36 +0200 |
commit | 202f55574f2f3f22f884a3ee7969194202f58deb (patch) | |
tree | 76d556bfe28e791f76929fb9129de56a3fb0403c /src/Common | |
parent | fae8ca32af7407653d21f7cbc4e9ea79751faab8 (diff) | |
parent | a39c7b60031f7479c9f7d27e7c69407be6fe49d0 (diff) | |
download | mad-202f55574f2f3f22f884a3ee7969194202f58deb.tar mad-202f55574f2f3f22f884a3ee7969194202f58deb.zip |
heads merged
Diffstat (limited to 'src/Common')
-rw-r--r-- | src/Common/Logger.cpp | 11 | ||||
-rw-r--r-- | src/Common/Logger.h | 4 |
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, ...); |