]> git.saurik.com Git - wxWidgets.git/blobdiff - src/common/log.cpp
Added --with-unicode (not used yet) and --with-wcsrtombs options
[wxWidgets.git] / src / common / log.cpp
index 6a1848932c0e2dbe112e6de3f64919f4fcaa4810..30b8258870b09ee3dfdca3a9089d09dc66b5cb10 100644 (file)
@@ -250,7 +250,7 @@ wxLog *wxLog::GetActiveTarget()
     if ( !s_bInGetActiveTarget ) {
       s_bInGetActiveTarget = TRUE;
 
-      #ifdef  WX_TEST_MINIMAL
+      #ifdef  wxUSE_NOGUI
         ms_pLogger = new wxLogStderr;
       #else
         // ask the application to create a log target for us
@@ -268,8 +268,9 @@ wxLog *wxLog::GetActiveTarget()
 wxLog *wxLog::SetActiveTarget(wxLog *pLogger, bool bNoFlashOld)
 {
   // flush the old messages before changing
-  if ( (ms_pLogger != NULL) && !bNoFlashOld )
+  if ( (ms_pLogger != NULL) && !bNoFlashOld ) {
     ms_pLogger->Flush();
+  }
 
   wxLog *pOldLogger = ms_pLogger;
   ms_pLogger = pLogger;
@@ -409,7 +410,7 @@ wxLogTextCtrl::~wxLogTextCtrl()
 // wxLogGui implementation
 // ----------------------------------------------------------------------------
 
-#ifndef   WX_TEST_MINIMAL
+#ifndef   wxUSE_NOGUI
 
 wxLogGui::wxLogGui()
 {
@@ -737,13 +738,29 @@ void wxLogWindow::DoLog(wxLogLevel level, const char *szString)
     ((wxLogWindow *)m_pOldLog)->DoLog(level, szString);
   }
 
-  // don't put trace messages in the text window for 2 reasons:
-  // 1) there are too many of them
-  // 2) they may provoke other trace messages thus sending a program into an
-  //    infinite loop
-  if ( m_pLogFrame && level != wxLOG_Trace ) {
-    // and this will format it nicely and call our DoLogString()
-    wxLog::DoLog(level, szString);
+  if ( m_pLogFrame ) {
+    switch ( level ) {
+      case wxLOG_Status:
+        // by default, these messages are ignored by wxLog, so process
+        // them ourselves
+        {
+          wxString str = TimeStamp();
+          str << _("Status: ") << szString;
+          DoLogString(str);
+        }
+        break;
+
+      // don't put trace messages in the text window for 2 reasons:
+      // 1) there are too many of them
+      // 2) they may provoke other trace messages thus sending a program
+      //    into an infinite loop
+      case wxLOG_Trace:
+        break;
+
+      default:
+        // and this will format it nicely and call our DoLogString()
+        wxLog::DoLog(level, szString);
+    }
   }
 
   m_bHasMessages = TRUE;
@@ -787,7 +804,7 @@ wxLogWindow::~wxLogWindow()
   delete m_pLogFrame;
 }
 
-#endif  //WX_TEST_MINIMAL
+#endif  //wxUSE_NOGUI
 
 // ============================================================================
 // Global functions/variables