X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/c11d62a6e22ead4c327b7ad45ad466b451b1aff6..f357c0d42c17bf5be30e65e68cd99c474678da71:/src/common/log.cpp?ds=sidebyside diff --git a/src/common/log.cpp b/src/common/log.cpp index b577f27aef..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 } // ---------------------------------------------------------------------------- @@ -509,9 +507,8 @@ wxLogStderr::wxLogStderr(FILE *fp) m_fp = fp; } -#if defined(__WXMAC__) && !defined(__DARWIN__) && (__MWERKS__ > 0x5300) +#if defined(__WXMAC__) && !defined(__DARWIN__) && defined(__MWERKS__) && (__MWERKS__ >= 0x2400) -#if !TARGET_API_MAC_CARBON // MetroNub stuff doesn't seem to work in CodeWarrior 5.3 Carbon builds... #ifndef __MetroNubUtils__ @@ -694,9 +691,7 @@ OSErr ClearWatchPoint (WatchPointIDT watchPointID) } #endif -#endif // !TARGET_API_MAC_CARBON - -#endif // defined(__WXMAC__) && !defined(__DARWIN__) && (__MWERKS__ > 0x5300) +#endif // defined(__WXMAC__) && !defined(__DARWIN__) && (__MWERKS__ >= 0x2400) void wxLogStderr::DoLogString(const wxChar *szString, time_t WXUNUSED(t)) { @@ -709,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() ) ; @@ -722,7 +723,7 @@ void wxLogStderr::DoLogString(const wxChar *szString, time_t WXUNUSED(t)) Boolean running = false ; -#if !TARGET_API_MAC_CARBON && (__MWERKS__ > 0x5300) +#if defined(__MWERKS__) && (__MWERKS__ >= 0x2400) if ( IsMWDebuggerRunning() && AmIBeingMWDebugged() ) { @@ -747,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 ) @@ -796,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(); } @@ -848,6 +850,8 @@ bool wxLog::ms_doLog = TRUE; bool wxLog::ms_bAutoCreate = TRUE; bool wxLog::ms_bVerbose = FALSE; +wxLogLevel wxLog::ms_logLevel = wxLOG_Max; // log everything by default + size_t wxLog::ms_suspendCount = 0; #if wxUSE_GUI