diff options
Diffstat (limited to 'src/log.cpp')
-rw-r--r-- | src/log.cpp | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/src/log.cpp b/src/log.cpp index 9a5ebe8a..24cb6e9d 100644 --- a/src/log.cpp +++ b/src/log.cpp @@ -45,14 +45,19 @@ void Logger::setLogFile(const std::string &logFilename) void Logger::log(const char *log_text, ...) { + va_list ap; + va_start(ap, log_text); + vlog(log_text, ap); + va_end(ap); +} + +void Logger::vlog(const char *log_text, va_list ap) +{ const size_t bufSize = 1024; char* buf = new char[bufSize]; - va_list ap; // Use a temporary buffer to fill in the variables - va_start(ap, log_text); vsnprintf(buf, bufSize, log_text, ap); - va_end(ap); // Get the current system time timeval tv; |