Support Android logging.
This commit is contained in:
parent
04cbeb0f8a
commit
85cc2acd6f
1 changed files with 13 additions and 0 deletions
|
|
@ -39,6 +39,10 @@
|
|||
#include "wx/msw/private.h"
|
||||
#endif
|
||||
|
||||
#if defined(__ANDROID__)
|
||||
#include <android/log.h>
|
||||
#endif
|
||||
|
||||
// ===========================================================================
|
||||
// implementation
|
||||
// ===========================================================================
|
||||
|
|
@ -143,8 +147,13 @@ wxMessageOutputStderr::wxMessageOutputStderr(FILE *fp, const wxMBConv& conv)
|
|||
void wxMessageOutputStderr::Output(const wxString& str)
|
||||
{
|
||||
const wxCharBuffer& buf = PrepareForOutput(str);
|
||||
|
||||
#if defined(__ANDROID__)
|
||||
__android_log_write(ANDROID_LOG_INFO, "wxWidgets", buf.data());
|
||||
#else
|
||||
fwrite(buf, buf.length(), 1, m_fp);
|
||||
fflush(m_fp);
|
||||
#endif
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
|
|
@ -158,6 +167,10 @@ void wxMessageOutputDebug::Output(const wxString& str)
|
|||
out.Replace(wxT("\t"), wxT(" "));
|
||||
out.Replace(wxT("\n"), wxT("\r\n"));
|
||||
::OutputDebugString(out.t_str());
|
||||
#elif defined(__ANDROID__)
|
||||
const wxCharBuffer& buf = PrepareForOutput(str);
|
||||
|
||||
__android_log_write(ANDROID_LOG_DEBUG, "wxWidgets", buf.data());
|
||||
#else
|
||||
// TODO: use native debug output function for the other ports too
|
||||
wxMessageOutputStderr::Output(str);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue