X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/edc738528aec4da25b8ee0b306cc2a0193ae0386..f352dd54f0c495798d73e54ec96be8d628a2c787:/src/common/log.cpp diff --git a/src/common/log.cpp b/src/common/log.cpp index 8c5c23be29..81ab68239b 100644 --- a/src/common/log.cpp +++ b/src/common/log.cpp @@ -351,7 +351,6 @@ void WXDLLEXPORT wxLogSysError(long lErrCode, const wxChar *szFormat, ...) wxLog::wxLog() { - m_bHasMessages = FALSE; } wxChar *wxLog::SetLogBuffer( wxChar *buf, size_t size) @@ -493,8 +492,7 @@ void wxLog::DoLogString(const wxChar *WXUNUSED(szString), time_t WXUNUSED(t)) void wxLog::Flush() { - // remember that we don't have any more messages to show - m_bHasMessages = FALSE; + // nothing to do here } // ---------------------------------------------------------------------------- @@ -706,11 +704,17 @@ void wxLogStderr::DoLogString(const wxChar *szString, time_t WXUNUSED(t)) fflush(m_fp); // under Windows, programs usually don't have stderr at all, so show the - // messages also under debugger - unless it's a console program + // messages also under debugger (unless it's a console program which does + // have stderr or unless this is a file logger which doesn't use stderr at + // all) #if defined(__WXMSW__) && wxUSE_GUI && !defined(__WXMICROWIN__) - str += wxT("\r\n") ; - OutputDebugString(str.c_str()); + if ( m_fp == stderr ) + { + str += wxT("\r\n") ; + OutputDebugString(str.c_str()); + } #endif // MSW + #if defined(__WXMAC__) && !defined(__DARWIN__) && wxUSE_GUI Str255 pstr ; strcpy( (char*) pstr , str.c_str() ) ; @@ -744,6 +748,7 @@ void wxLogStderr::DoLogString(const wxChar *szString, time_t WXUNUSED(t)) // ---------------------------------------------------------------------------- #if wxUSE_STD_IOSTREAM +#include "wx/ioswrap.h" wxLogStream::wxLogStream(wxSTD ostream *ostr) { if ( ostr == NULL ) @@ -793,7 +798,7 @@ void wxLogChain::Flush() if ( m_logOld ) m_logOld->Flush(); - // be careful to avoid inifinite recursion + // be careful to avoid infinite recursion if ( m_logNew && m_logNew != this ) m_logNew->Flush(); }