From 49311b0c6df075b556e0941ef82b43757e94555c Mon Sep 17 00:00:00 2001 From: brain Date: Tue, 12 Dec 2006 23:31:13 +0000 Subject: Avoid pointless vsnprintf() when our loglevel doesnt meet requirements git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@5970 e03df62e-2008-0410-955e-edbf42e46eb7 --- src/helperfuncs.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/helperfuncs.cpp') diff --git a/src/helperfuncs.cpp b/src/helperfuncs.cpp index 05f2d79c3..2398e6668 100644 --- a/src/helperfuncs.cpp +++ b/src/helperfuncs.cpp @@ -32,6 +32,10 @@ static time_t LAST = 0; */ void InspIRCd::Log(int level, const char* text, ...) { + /* Do this check again here so that we save pointless vsnprintf calls */ + if ((level < Config->LogLevel) && !Config->forcedebug) + return; + va_list argsPtr; char textbuffer[65536]; -- cgit v1.2.3