--- a/src/util.c Wed Nov 10 08:23:05 2010 +1000 +++ b/src/util.c Sat Mar 03 15:52:59 2012 +1000 @@ -23,6 +23,7 @@ #include #include #include +#include #include #include #include @@ -34,6 +35,11 @@ #include "gui.h" #include "sh4/sh4.h" +#ifdef __ANDROID__ +#include +static int android_log_levels[] = {ANDROID_LOG_FATAL, ANDROID_LOG_ERROR, ANDROID_LOG_WARN, ANDROID_LOG_INFO, ANDROID_LOG_DEBUG, ANDROID_LOG_VERBOSE}; +#endif + char *msg_levels[] = { "FATAL", "ERROR", "WARN", "INFO", "DEBUG", "TRACE" }; int global_msg_level = EMIT_WARN; @@ -344,8 +350,11 @@ } } - strftime( buf, sizeof(buf), "%H:%M:%S", localtime(&tm) ); +#ifdef __ANDROID__ + __android_log_print(android_log_levels[level], "lxdream", "%s %08X %s\n", buf, sh4r.pc, text ); +#else fprintf( stderr, "%s %08X %-5s %s\n", buf, sh4r.pc, msg_levels[level], text ); +#endif g_free(text); }