Print crash log to Android logcat

This commit is contained in:
pelya
2015-04-12 21:55:29 +03:00
parent 564fbb6367
commit 52f4b584c7

View File

@@ -64,6 +64,10 @@ ULONG __stack = (1024*1024)*2; // maybe not that much is needed actually ;)
#endif
#endif
#ifdef __ANDROID__
#include "android/log.h"
#endif
#include "../../safeguards.h"
bool FiosIsRoot(const char *path)
@@ -243,6 +247,9 @@ void ShowInfo(const char *str)
#if !defined(__APPLE__)
void ShowOSErrorBox(const char *buf, bool system)
{
#ifdef __ANDROID__
__android_log_print(ANDROID_LOG_FATAL, "OpenTTD", "[ERROR] %s", buf);
#endif
/* All unix systems, except OSX. Only use escape codes on a TTY. */
if (isatty(fileno(stderr))) {
fprintf(stderr, "\033[1;31mError: %s\033[0;39m\n", buf);