@ -299,27 +299,24 @@ int LogPrint(const char* category, const char* pszFormat, ...)
# ifdef WIN32
# ifdef WIN32
if ( fPrintToDebugger )
if ( fPrintToDebugger )
{
{
static CCriticalSection cs_OutputDebugStringF ;
// accumulate and output a line at a time
// accumulate and output a line at a time
{
static std : : string buffer ;
LOCK ( cs_OutputDebugStringF ) ;
static std : : string buffer ;
va_list arg_ptr ;
boost : : mutex : : scoped_lock scoped_lock ( * mutexDebugLog ) ;
va_start ( arg_ptr , pszFormat ) ;
buffer + = vstrprintf ( pszFormat , arg_ptr ) ;
va_end ( arg_ptr ) ;
int line_start = 0 , line_end ;
va_list arg_ptr ;
while ( ( line_end = buffer . find ( ' \n ' , line_start ) ) ! = - 1 )
va_start ( arg_ptr , pszFormat ) ;
{
buffer + = vstrprintf ( pszFormat , arg_ptr ) ;
OutputDebugStringA ( buffer . substr ( line_start , line_end - line_start ) . c_str ( ) ) ;
va_end ( arg_ptr ) ;
line_start = line_end + 1 ;
ret + = line_end - line_start ;
int line_start = 0 , line_end ;
}
while ( ( line_end = buffer . find ( ' \n ' , line_start ) ) ! = - 1 )
buffer . erase ( 0 , line_start ) ;
{
OutputDebugStringA ( buffer . substr ( line_start , line_end - line_start ) . c_str ( ) ) ;
line_start = line_end + 1 ;
ret + = line_end - line_start ;
}
}
buffer . erase ( 0 , line_start ) ;
}
}
# endif
# endif
return ret ;
return ret ;