mirror of https://github.com/PCSX2/pcsx2.git
Fix logging in wxWidgets 3.0
wxWidgets 3.0 requires DoLogRecord, instead of DoLog, to be overridden.
This commit is contained in:
parent
8de94a3714
commit
3e69113f48
|
@ -42,8 +42,14 @@ PipeRedirectionBase::~PipeRedirectionBase() throw() {}
|
|||
|
||||
// ----------------------------------------------------------------------------
|
||||
//
|
||||
#if wxMAJOR_VERSION < 3
|
||||
void pxLogConsole::DoLog( wxLogLevel level, const wxChar *szString, time_t t )
|
||||
{
|
||||
wxString message(szString);
|
||||
#else
|
||||
void pxLogConsole::DoLogRecord(wxLogLevel level, const wxString &message, const wxLogRecordInfo &info)
|
||||
{
|
||||
#endif
|
||||
switch ( level )
|
||||
{
|
||||
case wxLOG_Trace:
|
||||
|
@ -51,7 +57,7 @@ void pxLogConsole::DoLog( wxLogLevel level, const wxChar *szString, time_t t )
|
|||
{
|
||||
wxString str;
|
||||
TimeStamp( &str );
|
||||
MSW_OutputDebugString( str + szString + L"\n" );
|
||||
MSW_OutputDebugString( str + message + L"\n" );
|
||||
}
|
||||
break;
|
||||
|
||||
|
@ -70,15 +76,15 @@ void pxLogConsole::DoLog( wxLogLevel level, const wxChar *szString, time_t t )
|
|||
// fallthrough!
|
||||
|
||||
case wxLOG_Message:
|
||||
Console.WriteLn( L"[wx] %ls", szString );
|
||||
Console.WriteLn( L"[wx] %s", WX_STR(message));
|
||||
break;
|
||||
|
||||
case wxLOG_Error:
|
||||
Console.Error( L"[wx] %ls", szString );
|
||||
Console.Error(L"[wx] %s", WX_STR(message));
|
||||
break;
|
||||
|
||||
case wxLOG_Warning:
|
||||
Console.Warning( L"[wx] %ls", szString );
|
||||
Console.Warning(L"[wx] %s", WX_STR(message));
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -57,7 +57,11 @@ public:
|
|||
pxLogConsole() {}
|
||||
|
||||
protected:
|
||||
#if wxMAJOR_VERSION >= 3
|
||||
virtual void DoLogRecord(wxLogLevel level, const wxString &message, const wxLogRecordInfo &info);
|
||||
#else
|
||||
virtual void DoLog(wxLogLevel level, const wxChar *szString, time_t t);
|
||||
#endif
|
||||
};
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue