]> git.saurik.com Git - wxWidgets.git/blobdiff - src/common/log.cpp
Correct wxSizer::InsertSpacer() description.
[wxWidgets.git] / src / common / log.cpp
index e0e0c03eea68b5e2304af01349333315810f9d0f..1d3ae8fffa51773193970140b26e6dab75d8b46f 100644 (file)
@@ -165,6 +165,25 @@ PreviousLogInfo gs_prevLog;
 // NB: all accesses to it must be protected by GetLevelsCS() critical section
 WX_DEFINE_GLOBAL_VAR(wxStringToNumHashMap, ComponentLevels);
 
+// ----------------------------------------------------------------------------
+// wxLogOutputBest: wxLog wrapper around wxMessageOutputBest
+// ----------------------------------------------------------------------------
+
+class wxLogOutputBest : public wxLog
+{
+public:
+    wxLogOutputBest() { }
+
+protected:
+    virtual void DoLogText(const wxString& msg)
+    {
+        wxMessageOutputBest().Output(msg);
+    }
+
+private:
+    wxDECLARE_NO_COPY_CLASS(wxLogOutputBest);
+};
+
 } // anonymous namespace
 
 // ============================================================================
@@ -362,7 +381,9 @@ void wxLog::DoLogRecord(wxLogLevel level,
     // but to call both of them
     DoLog(level, (const char*)msg.mb_str(), info.timestamp);
     DoLog(level, (const wchar_t*)msg.wc_str(), info.timestamp);
-#endif // WXWIN_COMPATIBILITY_2_8
+#else // !WXWIN_COMPATIBILITY_2_8
+    wxUnusedVar(info);
+#endif // WXWIN_COMPATIBILITY_2_8/!WXWIN_COMPATIBILITY_2_8
 
 
     // TODO: it would be better to extract message formatting in a separate
@@ -481,7 +502,7 @@ wxLog *wxLog::GetMainThreadActiveTarget()
             if ( wxTheApp != NULL )
                 ms_pLogger = wxTheApp->GetTraits()->CreateLogTarget();
             else
-                ms_pLogger = new wxLogStderr;
+                ms_pLogger = new wxLogOutputBest;
 
             s_bInGetActiveTarget = false;