X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/84fff0b395adcfecd09dd65389ba7c1c47dd7eee..f861258fcace51a1aaba2f31c7498b3ba9e31371:/src/common/log.cpp diff --git a/src/common/log.cpp b/src/common/log.cpp index bafc4b8466..0a3e9bdd92 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: - case wxLOG_Message: if ( GetVerbose() ) - DoLogString(str + szString, t); + case wxLOG_Message: + default: // log unknown log levels too + DoLogString(szString, t); // fall through case wxLOG_Status: @@ -346,11 +345,7 @@ void wxLog::DoLog(wxLogLevel level, const wxChar *szString, time_t t) #ifdef __WXDEBUG__ DoLogString(szString, t); #endif - break; - - default: - wxFAIL_MSG(_("unknown log level in wxLog::DoLog")); } } @@ -570,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")); } } @@ -789,6 +781,7 @@ void wxLogWindow::DoLog(wxLogLevel level, const wxChar *szString, time_t t) case wxLOG_Status: // by default, these messages are ignored by wxLog, so process // them ourselves + if ( !wxIsEmpty(szString) ) { wxString str; str << _("Status: ") << szString; @@ -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 ) {