aboutsummaryrefslogtreecommitdiff
path: root/nxcompshad/src/Logger.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'nxcompshad/src/Logger.cpp')
-rw-r--r--nxcompshad/src/Logger.cpp20
1 files changed, 16 insertions, 4 deletions
diff --git a/nxcompshad/src/Logger.cpp b/nxcompshad/src/Logger.cpp
index 9648509b8..2f3eab65c 100644
--- a/nxcompshad/src/Logger.cpp
+++ b/nxcompshad/src/Logger.cpp
@@ -41,11 +41,14 @@
Logger logger;
-void Logger::user(const char *format, va_list arguments)
+void Logger::user(const char *format, ...)
{
char string[1024];
+ va_list arguments;
+ va_start(arguments, format);
vsnprintf(string, 1024, format, arguments);
+ va_end(arguments);
fprintf(stderr, "%s\n", string);
}
@@ -56,20 +59,26 @@ void Logger::error(const char *name, int error)
name, error, strerror(error));
}
-void Logger::warning(const char *name, const char *format, va_list arguments)
+void Logger::warning(const char *name, const char *format, ...)
{
char string[1024];
+ va_list arguments;
+ va_start(arguments, format);
vsnprintf(string, 1024, format, arguments);
+ va_end(arguments);
fprintf(stderr, "%s: WARNING! %s\n", name, string);
}
-void Logger::test(const char *name, const char *format, va_list arguments)
+void Logger::test(const char *name, const char *format, ...)
{
char string[1024];
+ va_list arguments;
+ va_start(arguments, format);
vsnprintf(string, 1024, format, arguments);
+ va_end(arguments);
fprintf(stderr, "%s: %s\n", name, string);
}
@@ -79,11 +88,14 @@ void Logger::trace(const char *name)
fprintf(stderr, "%s\n", name);
}
-void Logger::debug(const char *name, const char *format, va_list arguments)
+void Logger::debug(const char *name, const char *format, ...)
{
char string[1024];
+ va_list arguments;
+ va_start(arguments, format);
vsnprintf(string, 1024, format, arguments);
+ va_end(arguments);
fprintf(stderr, "%s: %s\n", name, string);
}