IMPLEMENT_LOG_FUNCTION(Info)
IMPLEMENT_LOG_FUNCTION(Status)
+void wxSafeShowMessage(const wxString& title, const wxString& text)
+{
+#ifdef __WINDOWS__
+ ::MessageBox(NULL, text, title, MB_OK | MB_ICONSTOP);
+#else
+ wxFprintf(stderr, _T("%s: %s\n"), title.c_str(), text.c_str());
+#endif
+}
+
// fatal errors can't be suppressed nor handled by the custom log target and
// always terminate the program
void wxVLogFatalError(const wxChar *szFormat, va_list argptr)
{
wxVsnprintf(s_szBuf, s_szBufSize, szFormat, argptr);
-#if wxUSE_GUI
- wxMessageBox(s_szBuf, _("Fatal Error"), wxID_OK | wxICON_STOP);
-#else
- wxFprintf(stderr, _("Fatal error: %s\n"), s_szBuf);
-#endif
+ wxSafeShowMessage(_T("Fatal Error"), s_szBuf);
abort();
}
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__
}
#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))
{
Boolean running = false ;
-#if !TARGET_API_MAC_CARBON && (__MWERKS__ > 0x5300)
+#if defined(__MWERKS__) && (__MWERKS__ >= 0x2400)
if ( IsMWDebuggerRunning() && AmIBeingMWDebugged() )
{
wxLogChain::wxLogChain(wxLog *logger)
{
+ m_bPassMessages = TRUE;
+
m_logNew = logger;
m_logOld = wxLog::SetActiveTarget(this);
}
wxLogChain::~wxLogChain()
{
- delete m_logNew;
+ delete m_logOld;
+
+ if ( m_logNew != this )
+ delete m_logNew;
}
void wxLogChain::SetLog(wxLog *logger)
if ( m_logNew != this )
delete m_logNew;
- wxLog::SetActiveTarget(logger);
-
m_logNew = logger;
}
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