From 2bd34b7037095f5007cf0acc36a32916ff0ea74e Mon Sep 17 00:00:00 2001 From: w00t Date: Sat, 9 Feb 2008 13:06:02 +0000 Subject: Add a printf-type override for LogManager::Log(). We need to find a way to see if a log call would have any interest, to avoid unnecessary printf() here though. Convert a bunch of stuff to using new logging (added targets: USERS, USERIO) git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@8860 e03df62e-2008-0410-955e-edbf42e46eb7 --- src/logger.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'src/logger.cpp') 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 >::iterator i = LogStreams.find(type); -- cgit v1.2.3