added code to log all errors to logcat when on android.

This commit is contained in:
gardners 2012-04-30 20:45:50 +09:30
parent 70a0f9e4a1
commit e14793486d

7
dna.c
View File

@ -84,6 +84,10 @@ int dumpResponses(struct response_set *responses)
return 0;
}
#ifdef ANDROID
#include <android/log.h>
#endif
int setReason(char *fmt, ...)
{
va_list ap,ap2;
@ -96,6 +100,9 @@ int setReason(char *fmt, ...)
va_end(ap);
#ifdef ANDROID
__android_log_print(ANDROID_LOG_DEBUG, "servald", "%s",msg);
#endif
fprintf(stderr,"Error: %s\n",msg);
return -1;
}