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
commita59af08df17de6da9ef3a17296c7eb85fc234d57 (patch)
treeaac4ffcf404c06333d67be15aeec940a047e25c2 /navit/debug.c
parenteeca9385d1e063b7bdd328882aee3d2895bf9298 (diff)
downloadnavit-svn-a59af08df17de6da9ef3a17296c7eb85fc234d57.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 9b3edaa3..3b3eb8a4 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
}
}