diff --git a/src/common/msgout.cpp b/src/common/msgout.cpp index 4eeefb0674..35c8dbd672 100644 --- a/src/common/msgout.cpp +++ b/src/common/msgout.cpp @@ -39,6 +39,10 @@ #include "wx/msw/private.h" #endif +#if defined(__ANDROID__) + #include +#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);