void wxLog::DoLog(wxLogLevel level, const wxChar *szString, time_t t)
{
- wxString str;
-
switch ( level ) {
case wxLOG_FatalError:
- DoLogString(str << _("Fatal error: ") << szString, t);
+ DoLogString(wxString(_("Fatal error: ")) + szString, t);
DoLogString(_("Program aborted."), t);
Flush();
abort();
break;
case wxLOG_Error:
- DoLogString(str << _("Error: ") << szString, t);
+ DoLogString(wxString(_("Error: ")) + szString, t);
break;
case wxLOG_Warning:
- DoLogString(str << _("Warning: ") << szString, t);
+ DoLogString(wxString(_("Warning: ")) + szString, t);
break;
case wxLOG_Info:
if ( GetVerbose() )
case wxLOG_Message:
- DoLogString(str + szString, t);
+ default: // log unknown log levels too
+ DoLogString(szString, t);
// fall through
case wxLOG_Status:
}
}
-void wxLog::DoLogString(const wxChar *WXUNUSED(szString), time_t t)
+void wxLog::DoLogString(const wxChar *WXUNUSED(szString), time_t WXUNUSED(t))
{
wxFAIL_MSG(_T("DoLogString must be overriden if it's called."));
}
m_fp = fp;
}
-void wxLogStderr::DoLogString(const wxChar *szString, time_t t)
+void wxLogStderr::DoLogString(const wxChar *szString, time_t WXUNUSED(t))
{
wxString str(szString);
str << _T('\n');
m_ostr = ostr;
}
-void wxLogStream::DoLogString(const wxChar *szString, time_t t)
+void wxLogStream::DoLogString(const wxChar *szString, time_t WXUNUSED(t))
{
- (*m_ostr) << szString << endl << flush;
+ (*m_ostr) << wxConv_libc.cWX2MB(szString) << endl << flush;
}
#endif // wxUSE_STD_IOSTREAM
m_bHasMessages = TRUE;
}
-void wxLogWindow::DoLogString(const wxChar *szString, time_t t)
+void wxLogWindow::DoLogString(const wxChar *szString, time_t WXUNUSED(t))
{
// put the text into our window
wxTextCtrl *pText = m_pLogFrame->TextCtrl();
}
// this function is called when an assert fails
-void wxOnAssert(const char *szFile, int nLine, const wxChar *szMsg)
+void wxOnAssert(const wxChar *szFile, int nLine, const wxChar *szMsg)
{
// this variable can be set to true to suppress "assert failure" messages
static bool s_bNoAsserts = FALSE;
wxSprintf(szBuf, _T("%s(%d): assert failed"), szFile, nLine);
#else // !VC++
// make the error message more clear for all the others
-#ifdef wxSprintf
wxSprintf(szBuf, _T("Assert failed in file %s at line %d"), szFile, nLine);
-#else
- wxSprintf(szBuf, _T("Assert failed in file %hs at line %d"), szFile, nLine);
-#endif
#endif // VC/!VC
if ( szMsg != NULL ) {