Print crash log to Android logcat
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user