X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/372789845514bbe4171026f09744d36b4555a3de..ec5d85fbd58bf6ef774e3d93b9e38d9f90b42d40:/src/common/log.cpp diff --git a/src/common/log.cpp b/src/common/log.cpp index 5b3a6f1ffc..243df81ac1 100644 --- a/src/common/log.cpp +++ b/src/common/log.cpp @@ -313,28 +313,27 @@ void wxLog::RemoveTraceMask(const wxString& str) 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: @@ -347,9 +346,6 @@ void wxLog::DoLog(wxLogLevel level, const wxChar *szString, time_t t) DoLogString(szString, t); #endif break; - - default: - wxFAIL_MSG(_("unknown log level in wxLog::DoLog")); } } @@ -405,7 +401,7 @@ wxLogStream::wxLogStream(ostream *ostr) void wxLogStream::DoLogString(const wxChar *szString, time_t t) { - (*m_ostr) << szString << endl << flush; + (*m_ostr) << wxConv_libc.cWX2MB(szString) << endl << flush; } #endif // wxUSE_STD_IOSTREAM @@ -569,9 +565,6 @@ void wxLogGui::DoLog(wxLogLevel level, const wxChar *szString, time_t t) m_aMessages.Add(szString); m_aTimes.Add((long)t); break; - - default: - wxFAIL_MSG(_("unknown log level in wxLogGui::DoLog")); } } @@ -996,7 +989,7 @@ void Trap() } // 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; @@ -1021,11 +1014,7 @@ void wxOnAssert(const char *szFile, int nLine, const wxChar *szMsg) 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 ) {