summaryrefslogtreecommitdiff
path: root/navit/debug.c
diff options
context:
space:
mode:
authormartin-s <martin-s@ffa7fe5e-494d-0410-b361-a75ebd5db220>2009-08-15 15:36:16 +0000
committermartin-s <martin-s@ffa7fe5e-494d-0410-b361-a75ebd5db220>2009-08-15 15:36:16 +0000
commit7b468a58ecb34aea246da47a08f34652ef1f836d (patch)
treeaac4ffcf404c06333d67be15aeec940a047e25c2 /navit/debug.c
parent17e937bac863ac3e5735d546e3fa68835f1e867f (diff)
downloadnavit-7b468a58ecb34aea246da47a08f34652ef1f836d.tar.gz
Add:Core:Again android...
git-svn-id: http://svn.code.sf.net/p/navit/code/trunk/navit@2466 ffa7fe5e-494d-0410-b361-a75ebd5db220
Diffstat (limited to 'navit/debug.c')
-rw-r--r--navit/debug.c37
1 files changed, 24 insertions, 13 deletions
diff --git a/navit/debug.c b/navit/debug.c
index 9b3edaa3c..3b3eb8a42 100644
--- a/navit/debug.c
+++ b/navit/debug.c
@@ -25,10 +25,15 @@
#include <time.h>
#include <sys/time.h>
#include <glib.h>
+#include "config.h"
#include "file.h"
#include "item.h"
#include "debug.h"
+#ifdef HAVE_API_ANDROID
+#include <android/log.h>
+#endif
+
#ifdef DEBUG_WIN32_CE_MESSAGEBOX
#include <windows.h>
#include <windowsx.h>
@@ -147,7 +152,24 @@ debug_vprintf(int level, const char *module, const int mlen, const char *functio
sprintf(buffer, "%s:%s", module, function);
if (debug_level_get(module) >= level || debug_level_get(buffer) >= level) {
-#ifndef DEBUG_WIN32_CE_MESSAGEBOX
+#if defined(DEBUG_WIN32_CE_MESSAGEBOX) || defined(HAVE_API_ANDROID)
+ char xbuffer[4096];
+ wchar_t muni[4096];
+ int len=0;
+ if (prefix) {
+ strcpy(xbuffer,buffer);
+ len=strlen(buffer);
+ xbuffer[len++]=':';
+ }
+ vsprintf(xbuffer+len,fmt,ap);
+#endif
+#ifdef DEBUG_WIN32_CE_MESSAGEBOX
+ mbstowcs(muni, xbuffer, strlen(xbuffer)+1);
+ MessageBoxW(NULL, muni, TEXT("Navit - Error"), MB_APPLMODAL|MB_OK|MB_ICONERROR);
+#else
+#ifdef HAVE_API_ANDROID
+ __android_log_print(ANDROID_LOG_ERROR,"navit", "%s", xbuffer);
+#else
if (! fp)
fp = stderr;
if (timestamp_prefix)
@@ -156,18 +178,7 @@ debug_vprintf(int level, const char *module, const int mlen, const char *functio
fprintf(fp,"%s:",buffer);
vfprintf(fp,fmt, ap);
fflush(fp);
-#else
- wchar_t muni[4096];
- char xbuffer[4096];
- int len=0;
- if (prefix) {
- strcpy(xbuffer,buffer);
- len=strlen(buffer);
- xbuffer[len++]=':';
- }
- vsprintf(xbuffer+len,fmt,ap);
- mbstowcs(muni, xbuffer, strlen(xbuffer)+1);
- MessageBoxW(NULL, muni, TEXT("Navit - Error"), MB_APPLMODAL|MB_OK|MB_ICONERROR);
+#endif
#endif
}
}