- switch ( level ) {
- case wxLOG_Info:
- if ( GetVerbose() )
- case wxLOG_Message:
- if ( !m_bErrors ) {
- m_aMessages.Add(szString);
- m_bHasMessages = TRUE;
- }
- break;
-
- case wxLOG_Status:
- {
- // find the top window and set it's status text if it has any
- wxFrame *pFrame = gs_pFrame;
- if ( pFrame == NULL ) {
- wxWindow *pWin = wxTheApp->GetTopWindow();
- if ( pWin != NULL && pWin->IsKindOf(CLASSINFO(wxFrame)) ) {
- pFrame = (wxFrame *)pWin;
- }
- }
-
- if ( pFrame != NULL )
- pFrame->SetStatusText(szString);
- }
- break;
-
- case wxLOG_Trace:
- case wxLOG_Debug:
- #ifdef __WXDEBUG__
- {
- wxString strTime = TimeStamp();
-
- #ifdef __WXMSW__
- // don't prepend debug/trace here: it goes to the debug window
- // anyhow, but do put a timestamp
- OutputDebugString(strTime + szString + "\n\r");
- #else
- // send them to stderr
- fprintf(stderr, "%s %s: %s\n",
- strTime.c_str(),
- level == wxLOG_Trace ? "Trace" : "Debug",
- szString);
- fflush(stderr);
- #endif
- }
- #endif // __WXDEBUG__
- break;
-
- case wxLOG_FatalError:
- // show this one immediately
- wxMessageBox(szString, _("Fatal error"), wxICON_HAND);
- break;
-
- case wxLOG_Error:
- case wxLOG_Warning:
- // discard earlier informational messages if this is the 1st error
- if ( !m_bErrors ) {
- m_aMessages.Empty();
- m_bHasMessages = TRUE;
- m_bErrors = TRUE;
- }
-
- m_aMessages.Add(szString);
- break;
-
- default:
- wxFAIL_MSG(_("unknown log level in wxLogGui::DoLog"));
- }
+ switch ( level ) {
+ case wxLOG_Info:
+ if ( GetVerbose() )
+ case wxLOG_Message:
+ if ( !m_bErrors ) {
+ m_aMessages.Add(szString);
+ m_aTimes.Add((long)t);
+ m_bHasMessages = TRUE;
+ }
+ break;
+
+ case wxLOG_Status:
+ {
+ // find the top window and set it's status text if it has any
+ wxFrame *pFrame = gs_pFrame;
+ if ( pFrame == NULL ) {
+ wxWindow *pWin = wxTheApp->GetTopWindow();
+ if ( pWin != NULL && pWin->IsKindOf(CLASSINFO(wxFrame)) ) {
+ pFrame = (wxFrame *)pWin;
+ }
+ }
+
+ if ( pFrame != NULL )
+ pFrame->SetStatusText(szString);
+ }
+ break;
+
+ case wxLOG_Trace:
+ case wxLOG_Debug:
+ #ifdef __WXDEBUG__
+ {
+ #ifdef __WXMSW__
+ // don't prepend debug/trace here: it goes to the
+ // debug window anyhow, but do put a timestamp
+ OutputDebugString(wxString(szString) + _T("\n\r"));
+ #else
+ // send them to stderr
+ wxFprintf(stderr, _T("%s: %s\n"),
+ level == wxLOG_Trace ? _T("Trace") : _T("Debug"),
+ szString);
+ fflush(stderr);
+ #endif
+ }
+ #endif // __WXDEBUG__
+
+ break;
+
+ case wxLOG_FatalError:
+ // show this one immediately
+ wxMessageBox(szString, _("Fatal error"), wxICON_HAND);
+ break;
+
+ case wxLOG_Error:
+ // discard earlier informational messages if this is the 1st
+ // error because they might not make sense any more
+ if ( !m_bErrors ) {
+ m_aMessages.Empty();
+ m_aTimes.Empty();
+ m_bHasMessages = TRUE;
+ m_bErrors = TRUE;
+ }
+ // fall through
+
+ case wxLOG_Warning:
+ if ( !m_bErrors ) {
+ // for the warning we don't discard the info messages
+ m_bWarnings = TRUE;
+ }
+
+ m_aMessages.Add(szString);
+ m_aTimes.Add((long)t);
+ break;
+ }