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