diff options
author | Robin Watts <robin.watts@artifex.com> | 2016-09-14 19:48:17 +0100 |
---|---|---|
committer | Robin Watts <robin.watts@artifex.com> | 2016-09-14 19:53:35 +0100 |
commit | bf63314097c7c37a950550f78237c091ecba1417 (patch) | |
tree | 76e002849c0ce9b32eda6182bc20074b96f88e1e /include | |
parent | ee714b548cbe43c3337bbf7fcba79a751b609151 (diff) | |
download | mupdf-bf63314097c7c37a950550f78237c091ecba1417.tar.xz |
Redirect fprintf to android logcat in debug builds.
This makes debugging much simpler.
Diffstat (limited to 'include')
-rw-r--r-- | include/mupdf/fitz/system.h | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/include/mupdf/fitz/system.h b/include/mupdf/fitz/system.h index cb5c2a4a..1723824f 100644 --- a/include/mupdf/fitz/system.h +++ b/include/mupdf/fitz/system.h @@ -215,12 +215,13 @@ typedef int fz_off_t; #ifdef __ANDROID__ #include <android/log.h> -#define LOG_TAG "libmupdf" -#define LOGI(...) __android_log_print(ANDROID_LOG_INFO,LOG_TAG,__VA_ARGS__) -#define LOGE(...) __android_log_print(ANDROID_LOG_ERROR,LOG_TAG,__VA_ARGS__) -#else -#define LOGI(...) do {} while(0) -#define LOGE(...) do {} while(0) +int fz_android_fprintf(FILE *file, const char *fmt, ...); +#ifdef DEBUG +/* Capture fprintf for stdout/stderr to the android logging + * stream. Only do this in debug builds as this implies a + * delay */ +#define fprintf fz_android_fprintf +#endif #endif /* inline is standard in C++. For some compilers we can enable it within C too. */ |