#include "wx/log.h"
#include "wx/thread.h"
+#if wxUSE_LOG
+
// other standard headers
#include <errno.h>
#include <stdlib.h>
wxLog::wxLog()
{
m_bHasMessages = FALSE;
-
- // enable verbose messages by default in the debug builds
-#ifdef __WXDEBUG__
- m_bVerbose = TRUE;
-#else // release
m_bVerbose = FALSE;
-#endif // debug/release
}
wxLog *wxLog::GetActiveTarget()
m_fp = fp;
}
-#if defined(__WXMAC__)
+#if defined(__WXMAC__) && !defined(__UNIX__)
#define kDebuggerSignature 'MWDB'
static Boolean FindProcessBySignature(OSType signature, ProcessInfoRec* info)
str += wxT("\r\n") ;
OutputDebugString(str.c_str());
#endif // MSW
-#if defined(__WXMAC__) && wxUSE_GUI
+#if defined(__WXMAC__) && !defined(__WXMAC_X__) && wxUSE_GUI
Str255 pstr ;
strcpy( (char*) pstr , str.c_str() ) ;
strcat( (char*) pstr , ";g" ) ;
DebugStr(pstr);
#endif
}
-#endif // MSW
+#endif // Mac
}
// ----------------------------------------------------------------------------
void wxLogStream::DoLogString(const wxChar *szString, time_t WXUNUSED(t))
{
- (*m_ostr) << wxConvertWX2MB(szString) << endl;
+ wxString str;
+ TimeStamp(&str);
+ (*m_ostr) << str << wxConvertWX2MB(szString) << endl;
}
#endif // wxUSE_STD_IOSTREAM
// developpers only
wxStrcat(szBuf, wxT("\nDo you want to stop the program?\nYou can also choose [Cancel] to suppress further warnings."));
-#if wxUSE_GUI
- switch ( wxMessageBox(szBuf, wxT("Debug"),
- wxYES_NO | wxCANCEL | wxICON_STOP ) ) {
- case wxYES:
+ // use the native message box if available: this is more robust than
+ // using our own
+#ifdef __WXMSW__
+ switch ( ::MessageBox(NULL, szBuf, _T("Debug"),
+ MB_YESNOCANCEL | MB_ICONSTOP ) ) {
+ case IDYES:
Trap();
break;
- case wxCANCEL:
+ case IDCANCEL:
s_bNoAsserts = TRUE;
break;
- //case wxNO: nothing to do
+ //case IDNO: nothing to do
}
-#else // !GUI, but MSW
- switch ( ::MessageBox(NULL, szBuf, _T("Debug"),
- MB_YESNOCANCEL | MB_ICONSTOP ) ) {
- case IDYES:
+#else // !MSW
+ switch ( wxMessageBox(szBuf, wxT("Debug"),
+ wxYES_NO | wxCANCEL | wxICON_STOP ) ) {
+ case wxYES:
Trap();
break;
- case IDCANCEL:
+ case wxCANCEL:
s_bNoAsserts = TRUE;
break;
- //case IDNO: nothing to do
+ //case wxNO: nothing to do
}
#endif // GUI or MSW
#endif //WXDEBUG
+#endif //wxUSE_LOG