Home | History | Annotate | Download | only in helper
      1 #include "DebugHelper.h"
      2 
      3 #include <stdarg.h>
      4 #include <stdio.h>
      5 #include <stdlib.h>
      6 #include <string.h>
      7 
      8 #define LOG_BUF_SIZE 1024
      9 
     10 #if USE_LOGGER && !defined(__arm__)
     11 int __android_log_print(int prio, const char *tag, const char *fmt, ...) {
     12   va_list ap;
     13   char buf[LOG_BUF_SIZE];
     14 
     15   va_start(ap, fmt);
     16   vsnprintf(buf, LOG_BUF_SIZE, fmt, ap);
     17   va_end(ap);
     18 
     19   return __android_log_write(prio, tag, buf);
     20 }
     21 
     22 int __android_log_write(int prio, const char *tag, const char *msg) {
     23   if (!tag) {
     24     tag = "";
     25   }
     26 
     27   return fprintf(stderr, "[%s] %s\n", tag, msg);
     28 }
     29 #endif // USE_LOGGER && !defined(__arm__)
     30