summaryrefslogtreecommitdiffstats
path: root/src/Common
diff options
context:
space:
mode:
Diffstat (limited to 'src/Common')
-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, ...);