+// ----------------------------------------------------------------------------
+// wxLogBuffer implementation
+// ----------------------------------------------------------------------------
+
+void wxLogBuffer::Flush()
+{
+ if ( !m_str.empty() )
+ {
+ wxMessageOutputBest out;
+ out.Printf(_T("%s"), m_str.c_str());
+ m_str.clear();
+ }
+}
+
+void wxLogBuffer::DoLog(wxLogLevel level, const wxString& szString, time_t t)
+{
+ switch ( level )
+ {
+ case wxLOG_Trace:
+ case wxLOG_Debug:
+#ifdef __WXDEBUG__
+ // 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
+ {
+ wxString str;
+ TimeStamp(&str);
+ str += szString;
+
+ wxMessageOutputDebug dbgout;
+ dbgout.Printf(_T("%s\n"), str.c_str());
+ }
+#endif // __WXDEBUG__
+ break;
+
+ default:
+ wxLog::DoLog(level, szString, t);
+ }
+}
+
+void wxLogBuffer::DoLogString(const wxString& szString, time_t WXUNUSED(t))
+{
+ m_str << szString << _T("\n");
+}
+