Search
lxdream.org :: lxdream/src/util.c :: diff
lxdream 0.9.1
released Jun 29
Download Now
filename src/util.c
changeset 1239:be3121267597
prev1148:8e75fab17be8
author nkeynes
date Sun May 24 19:46:06 2015 +1000 (8 years ago)
permissions -rw-r--r--
last change Remove static from gl_load_frame_buffer() - also needed by video_egl.c
Fix error location in gl_frame_buffer_to_tex
file annotate diff log raw
1.1 --- a/src/util.c Wed Nov 10 08:23:05 2010 +1000
1.2 +++ b/src/util.c Sun May 24 19:46:06 2015 +1000
1.3 @@ -23,6 +23,7 @@
1.4 #include <stdarg.h>
1.5 #include <stdio.h>
1.6 #include <stdlib.h>
1.7 +#include <unistd.h>
1.8 #include <signal.h>
1.9 #include <time.h>
1.10 #include <zlib.h>
1.11 @@ -34,6 +35,11 @@
1.12 #include "gui.h"
1.13 #include "sh4/sh4.h"
1.14
1.15 +#ifdef __ANDROID__
1.16 +#include <android/log.h>
1.17 +static int android_log_levels[] = {ANDROID_LOG_FATAL, ANDROID_LOG_ERROR, ANDROID_LOG_WARN, ANDROID_LOG_INFO, ANDROID_LOG_DEBUG, ANDROID_LOG_VERBOSE};
1.18 +#endif
1.19 +
1.20 char *msg_levels[] = { "FATAL", "ERROR", "WARN", "INFO", "DEBUG", "TRACE" };
1.21 int global_msg_level = EMIT_WARN;
1.22
1.23 @@ -344,8 +350,11 @@
1.24 }
1.25 }
1.26
1.27 -
1.28 strftime( buf, sizeof(buf), "%H:%M:%S", localtime(&tm) );
1.29 +#ifdef __ANDROID__
1.30 + __android_log_print(android_log_levels[level], "lxdream", "%s %08X %s\n", buf, sh4r.pc, text );
1.31 +#else
1.32 fprintf( stderr, "%s %08X %-5s %s\n", buf, sh4r.pc, msg_levels[level], text );
1.33 +#endif
1.34 g_free(text);
1.35 }
.