Allow to log messages to file on android
This commit is contained in:
parent
23883b83c1
commit
c013fcea61
@ -153,8 +153,8 @@ void Log::printMessage(int level, const char *component, const char *format,
|
||||
case LL_FATAL: alp = ANDROID_LOG_FATAL; break;
|
||||
default: alp = ANDROID_LOG_FATAL;
|
||||
}
|
||||
__android_log_vprint(alp, "SuperTuxKart", format, args);
|
||||
#else
|
||||
#endif
|
||||
|
||||
static const char *names[] = {"debug", "verbose ", "info ",
|
||||
"warn ", "error ", "fatal "};
|
||||
|
||||
@ -178,8 +178,12 @@ void Log::printMessage(int level, const char *component, const char *format,
|
||||
va_copy(out, args);
|
||||
|
||||
setTerminalColor((LogLevel)level);
|
||||
#ifdef ANDROID
|
||||
__android_log_vprint(alp, "SuperTuxKart", format, out);
|
||||
#else
|
||||
printf("[%s] %s: ", names[level], component);
|
||||
vprintf(format, out);
|
||||
#endif
|
||||
resetTerminalColor(); // this prints a \n
|
||||
|
||||
va_end(out);
|
||||
@ -225,8 +229,6 @@ void Log::printMessage(int level, const char *component, const char *format,
|
||||
MessageBoxA(NULL, message.c_str(), "SuperTuxKart - Fatal error", MB_OK);
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
} // printMessage
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user