Core: replace redirectional outStaticDebug with a copy of debug for future use and rewrite

--HG--
branch : trunk
This commit is contained in:
click
2010-08-22 16:33:43 +02:00
parent 6e7f11aa41
commit 5739c2efa9

View File

@@ -734,16 +734,49 @@ void Log::outDebug(const char * str, ...)
fflush(stdout);
}
void Log::outStaticDebug(const char * fmt, ...)
void Log::outStaticDebug(const char * str, ...)
{
#ifdef TRINITY_DEBUG
va_list ap;
char str[2048];
va_start(ap, str);
vsnprintf(str, 2048, fmt, ap);
va_end(ap);
outDebug(str);
#endif
if (!str)
return;
if (m_enableLogDB && m_dbLogLevel > LOGL_DETAIL)
{
va_list ap2;
va_start(ap2, str);
char nnew_str[MAX_QUERY_LEN];
vsnprintf(nnew_str, MAX_QUERY_LEN, str, ap2);
outDB(LOG_TYPE_DEBUG, nnew_str);
va_end(ap2);
}
if( m_logLevel > LOGL_DETAIL )
{
if (m_colored)
SetColor(true,m_colors[LOGL_DEBUG]);
va_list ap;
va_start(ap, str);
vutf8printf(stdout, str, &ap);
va_end(ap);
if(m_colored)
ResetColor(true);
printf( "\n" );
if (logfile)
{
outTimestamp(logfile);
va_list ap;
va_start(ap, str);
vfprintf(logfile, str, ap);
va_end(ap);
fprintf(logfile, "\n" );
fflush(logfile);
}
}
fflush(stdout);
}
void Log::outStringInLine(const char * str, ...)