wxLogStderr sends output to debugger too under Windows

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@1896 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
1999-03-10 22:03:06 +00:00
parent 5e0b1434d4
commit 1e8a4bc241

View File

@@ -387,9 +387,17 @@ wxLogStderr::wxLogStderr(FILE *fp)
void wxLogStderr::DoLogString(const char *szString) void wxLogStderr::DoLogString(const char *szString)
{ {
fputs(szString, m_fp); wxString str(szString);
fputc('\n', m_fp); str << '\n';
fputs(str, m_fp);
fflush(m_fp); fflush(m_fp);
// under Windows, programs usually don't have stderr at all, so make show the
// messages also under debugger
#ifdef __WXMSW__
OutputDebugString(str + '\r');
#endif // MSW
} }
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
@@ -524,18 +532,14 @@ void wxLogGui::DoLog(wxLogLevel level, const char *szString)
OutputDebugString(strTime + szString + "\n\r"); OutputDebugString(strTime + szString + "\n\r");
#else #else
// send them to stderr // send them to stderr
/*
fprintf(stderr, "%s %s: %s\n", fprintf(stderr, "%s %s: %s\n",
strTime.c_str(), strTime.c_str(),
level == wxLOG_Trace ? _("Trace") : _("Debug"), level == wxLOG_Trace ? "Trace" : "Debug",
szString);
*/
fprintf(stderr, "%s\n",
szString); szString);
fflush(stderr); fflush(stderr);
#endif #endif
} }
#endif #endif // __WXDEBUG__
break; break;
case wxLOG_FatalError: case wxLOG_FatalError:
@@ -984,6 +988,8 @@ void wxOnAssert(const char *szFile, int nLine, const char *szMsg)
// He-e-e-e-elp!! we're trapped in endless loop // He-e-e-e-elp!! we're trapped in endless loop
Trap(); Trap();
s_bInAssert = FALSE;
return; return;
} }