-void wxLog::DoLog(wxLogLevel level, const wxString& szString, time_t t)
-{
-#if WXWIN_COMPATIBILITY_2_8
- // DoLog() signature changed since 2.8, so we call the old versions here
- // so that existing custom log classes still work:
- DoLog(level, (const char*)szString.mb_str(), t);
- DoLog(level, (const wchar_t*)szString.wc_str(), t);
-#endif
-
- switch ( level ) {
- case wxLOG_FatalError:
- LogString(_("Fatal error: ") + szString, t);
- LogString(_("Program aborted."), t);
- Flush();
-#ifdef __WXWINCE__
- ExitThread(3);
-#else
- abort();
-#endif
- break;
-
- case wxLOG_Error:
- LogString(_("Error: ") + szString, t);
- break;
-
- case wxLOG_Warning:
- LogString(_("Warning: ") + szString, t);
- break;
-
- case wxLOG_Info:
- if ( GetVerbose() )
- case wxLOG_Message:
- case wxLOG_Status:
- default: // log unknown log levels too
- LogString(szString, t);
- break;
-
-#if wxUSE_LOG_DEBUG || wxUSE_LOG_TRACE
-#if wxUSE_LOG_TRACE
- case wxLOG_Trace:
-#endif
-#if wxUSE_LOG_DEBUG
- case wxLOG_Debug:
-#endif
- {
- wxString str;
-
- // don't prepend "debug/trace" prefix under MSW as it goes to
- // the debug window anyhow and don't add time stamp neither as
- // debug output viewers under Windows typically add it
- // themselves anyhow
- #ifndef __WXMSW__
- TimeStamp(&str);
-
- str += level == wxLOG_Trace ? wxT("Trace: ")
- : wxT("Debug: ");
- #endif // !__WXMSW__
-
- str += szString;
- wxMessageOutputDebug().Output(str);
- }
- break;
-#endif // wxUSE_LOG_DEBUG || wxUSE_LOG_TRACE
- }
-}
-
-void wxLog::DoLogString(const wxString& szString, time_t t)
-{
-#if WXWIN_COMPATIBILITY_2_8
- // DoLogString() signature changed since 2.8, so we call the old versions
- // here so that existing custom log classes still work; unfortunately this
- // also means that we can't have the wxFAIL_MSG below in compat mode
- DoLogString((const char*)szString.mb_str(), t);
- DoLogString((const wchar_t*)szString.wc_str(), t);
-#else
- wxFAIL_MSG(wxS("DoLogString must be overriden if it's called."));
- wxUnusedVar(szString);
- wxUnusedVar(t);
-#endif
-}
-