diff options
Diffstat (limited to 'src/logger.cpp')
-rw-r--r-- | src/logger.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/logger.cpp b/src/logger.cpp index 83a657216..c30dae832 100644 --- a/src/logger.cpp +++ b/src/logger.cpp @@ -101,6 +101,18 @@ bool LogManager::DelLogType(const std::string &type, LogStream *l) return false; } +void LogManager::Log(const std::string &type, int loglevel, const char *fmt, ...) +{ + va_list a; + char buf[65536]; + + va_start(a, fmt); + vsnprintf(buf, 65536, fmt, a); + va_end(a); + + this->Log(type, loglevel, std::string(buf)); +} + void LogManager::Log(const std::string &type, int loglevel, const std::string &msg) { std::map<std::string, std::vector<LogStream *> >::iterator i = LogStreams.find(type); |