@ -530,113 +530,6 @@ void CFileDisplayer::doDisplay ( const CLog::TDisplayInfo& args, const char *mes
void CMsgBoxDisplayer : : doDisplay ( const CLog : : TDisplayInfo & args , const char * message )
{
bool needSpace = false ;
// stringstream ss;
string str ;
// create the string for the clipboard
if ( args . Date ! = 0 )
{
str + = dateToHumanString ( args . Date ) ;
needSpace = true ;
}
if ( args . LogType ! = CLog : : LOG_NO )
{
//if (needSpace) { ss << " "; needSpace = false; }
if ( needSpace ) { str + = " " ; needSpace = false ; }
str + = logTypeToString ( args . LogType ) ;
needSpace = true ;
}
if ( ! args . ProcessName . empty ( ) )
{
//if (needSpace) { ss << " "; needSpace = false; }
if ( needSpace ) { str + = " " ; needSpace = false ; }
str + = args . ProcessName ;
needSpace = true ;
}
if ( args . FileName ! = NULL )
{
//if (needSpace) { ss << " "; needSpace = false; }
if ( needSpace ) { str + = " " ; needSpace = false ; }
str + = CFile : : getFilename ( args . FileName ) ;
needSpace = true ;
}
if ( args . Line ! = - 1 )
{
//if (needSpace) { ss << " "; needSpace = false; }
if ( needSpace ) { str + = " " ; needSpace = false ; }
str + = NLMISC : : toString ( args . Line ) ;
needSpace = true ;
}
if ( args . FuncName ! = NULL )
{
//if (needSpace) { ss << " "; needSpace = false; }
if ( needSpace ) { str + = " " ; needSpace = false ; }
str + = args . FuncName ;
needSpace = true ;
}
if ( needSpace ) { str + = " : " ; needSpace = false ; }
str + = message ;
CSystemUtils : : copyTextToClipboard ( str ) ;
// create the string on the screen
needSpace = false ;
// stringstream ss2;
string str2 ;
# ifdef NL_DEBUG
if ( ! args . ProcessName . empty ( ) )
{
if ( needSpace ) { str2 + = " " ; needSpace = false ; }
str2 + = args . ProcessName ;
needSpace = true ;
}
if ( args . FileName ! = NULL )
{
if ( needSpace ) { str2 + = " " ; needSpace = false ; }
str2 + = CFile : : getFilename ( args . FileName ) ;
needSpace = true ;
}
if ( args . Line ! = - 1 )
{
if ( needSpace ) { str2 + = " " ; needSpace = false ; }
str2 + = NLMISC : : toString ( args . Line ) ;
needSpace = true ;
}
if ( args . FuncName ! = NULL )
{
if ( needSpace ) { str2 + = " " ; needSpace = false ; }
str2 + = args . FuncName ;
needSpace = true ;
}
if ( needSpace ) { str2 + = " : " ; needSpace = false ; }
# endif // NL_DEBUG
str2 + = message ;
str2 + = " \n \n (this message was copied in the clipboard) " ;
/* if (IsDebuggerPresent ())
{
// Must break in assert call
DebugNeedAssert = true ;
}
else
*/ {
// Display the report
string body ;
@ -657,68 +550,7 @@ void CMsgBoxDisplayer::doDisplay ( const CLog::TDisplayInfo& args, const char *m
body + = args . CallstackAndLog ;
string subject ;
// procname is host/service_name-sid we only want the service_name to avoid redondant mail
string procname ;
string : : size_type pos = args . ProcessName . find ( " / " ) ;
if ( pos = = string : : npos )
{
procname = args . ProcessName ;
}
else
{
string : : size_type pos2 = args . ProcessName . find ( " - " , pos + 1 ) ;
if ( pos2 = = string : : npos )
{
procname = args . ProcessName . substr ( pos + 1 ) ;
}
else
{
procname = args . ProcessName . substr ( pos + 1 , pos2 - pos - 1 ) ;
}
}
subject + = procname + " NeL " + toString ( LogTypeToString [ 0 ] [ args . LogType ] ) + " " + ( args . FileName ? string ( args . FileName ) : " " ) + " " + toString ( args . Line ) + " " + ( args . FuncName ? string ( args . FuncName ) : " " ) ;
// Check the envvar NEL_IGNORE_ASSERT
if ( getenv ( " NEL_IGNORE_ASSERT " ) = = NULL )
{
// yoyo: allow only to send the crash report once. Because users usually click ignore,
// which create noise into list of bugs (once a player crash, it will surely continues to do it).
std : : string filename = getLogDirectory ( ) + NL_CRASH_DUMP_FILE ;
if ( ReportDebug = = report ( args . ProcessName + " NeL " + toString ( logTypeToString ( args . LogType , true ) ) , " " , subject , body , true , 2 , true , 1 , ! isCrashAlreadyReported ( ) , IgnoreNextTime , filename . c_str ( ) ) )
{
INelContext : : getInstance ( ) . setDebugNeedAssert ( true ) ;
}
// no more sent mail for crash
setCrashAlreadyReported ( true ) ;
}
/* // Check the envvar NEL_IGNORE_ASSERT
if ( getenv ( " NEL_IGNORE_ASSERT " ) = = NULL )
{
// Ask the user to continue, debug or ignore
int result = MessageBox ( NULL , ss2 . str ( ) . c_str ( ) , logTypeToString ( args . LogType , true ) , MB_ABORTRETRYIGNORE | MB_ICONSTOP ) ;
if ( result = = IDABORT )
{
// Exit the program now
exit ( EXIT_FAILURE ) ;
}
else if ( result = = IDRETRY )
{
// Give the debugger a try
DebugNeedAssert = true ;
}
else if ( result = = IDIGNORE )
{
// Continue, do nothing
}
}
*/ }
report ( body ) ;
}