From: Attila Molnar Date: Wed, 22 May 2013 00:11:46 +0000 (-0700) Subject: Merge pull request #545 from SaberUK/master+logging-cleanup X-Git-Url: https://git.netwichtig.de/gitweb/?a=commitdiff_plain;h=b36ce84c7da93f680fc397bcb4c877abe063eaaa;p=user%2Fhenk%2Fcode%2Finspircd.git Merge pull request #545 from SaberUK/master+logging-cleanup Clean up the logging system (part 1 of 2). --- b36ce84c7da93f680fc397bcb4c877abe063eaaa diff --cc src/logger.cpp index 2b0b623f6,c83a423f0..bbbb7eafa --- a/src/logger.cpp +++ b/src/logger.cpp @@@ -293,17 -296,24 +296,17 @@@ bool LogManager::DelLogType(const std:: return true; } - void LogManager::Log(const std::string &type, int loglevel, const char *fmt, ...) + void LogManager::Log(const std::string &type, LogLevel loglevel, const char *fmt, ...) { if (Logging) - { return; - } - - va_list a; - static char buf[65536]; - - va_start(a, fmt); - vsnprintf(buf, 65536, fmt, a); - va_end(a); - this->Log(type, loglevel, std::string(buf)); + std::string buf; + VAFORMAT(buf, fmt, fmt); + this->Log(type, loglevel, buf); } - void LogManager::Log(const std::string &type, int loglevel, const std::string &msg) + void LogManager::Log(const std::string &type, LogLevel loglevel, const std::string &msg) { if (Logging) {