+// ----------------------------------------------------------------------------
+// wxLogBuffer implementation
+// ----------------------------------------------------------------------------
+
+void wxLogBuffer::Flush()
+{
+ if ( !m_str.empty() )
+ {
+ wxMessageOutputBest out;
+ out.Printf(wxS("%s"), m_str.c_str());
+ m_str.clear();
+ }
+}
+
+#if wxUSE_LOG_DEBUG || wxUSE_LOG_TRACE
+
+void wxLogBuffer::DoLog(wxLogLevel level, const wxString& szString, time_t t)
+{
+ // don't put debug messages in the buffer, we don't want to show
+ // them to the user in a msg box, log them immediately
+ bool showImmediately = false;
+#if wxUSE_LOG_TRACE
+ if ( level == wxLOG_Trace )
+ showImmediately = true;
+#endif
+#if wxUSE_LOG_DEBUG
+ if ( level == wxLOG_Debug )
+ showImmediately = true;
+#endif
+
+ if ( showImmediately )
+ {
+ wxString str;
+ TimeStamp(&str);
+ str += szString;
+
+ wxMessageOutputDebug dbgout;
+ dbgout.Printf(wxS("%s\n"), str.c_str());
+ }
+ else
+ {
+ wxLog::DoLog(level, szString, t);
+ }
+}
+
+#endif // wxUSE_LOG_DEBUG || wxUSE_LOG_TRACE
+
+void wxLogBuffer::DoLogString(const wxString& szString, time_t WXUNUSED(t))
+{
+ m_str << szString << wxS("\n");
+}
+