diff options
author | 2012-07-27 05:20:35 -0700 | |
---|---|---|
committer | 2012-07-27 05:20:35 -0700 | |
commit | 0cea6fdbde7f0b35491207ef509cb9f6e58fc6af (patch) | |
tree | cdf1e5838a464329de9dc648eb92a6c8d0301e7b | |
parent | c3a4a3e1899ba8264343d103b97de0a3d6d16d21 (diff) | |
parent | e3f26dd21e16a7d8c23a95a5084947e54ba598e1 (diff) | |
download | latinime-0cea6fdbde7f0b35491207ef509cb9f6e58fc6af.tar.gz latinime-0cea6fdbde7f0b35491207ef509cb9f6e58fc6af.tar.xz latinime-0cea6fdbde7f0b35491207ef509cb9f6e58fc6af.zip |
am e3f26dd2: Fix native debug log
* commit 'e3f26dd21e16a7d8c23a95a5084947e54ba598e1':
Fix native debug log
-rw-r--r-- | native/jni/Android.mk | 8 | ||||
-rw-r--r-- | native/jni/src/defines.h | 14 |
2 files changed, 10 insertions, 12 deletions
diff --git a/native/jni/Android.mk b/native/jni/Android.mk index e9ca91a59..9f9958377 100644 --- a/native/jni/Android.mk +++ b/native/jni/Android.mk @@ -15,8 +15,8 @@ LOCAL_PATH := $(call my-dir) ############ some local flags -# If you change any of those flags, you need to rebuild both libjni_latinime_static -# and the shared library. +# If you change any of those flags, you need to rebuild both libjni_latinime_common_static +# and the shared library that uses libjni_latinime_common_static. FLAG_DBG ?= false FLAG_DO_PROFILE ?= false @@ -82,11 +82,11 @@ LOCAL_WHOLE_STATIC_LIBRARIES := libjni_latinime_common_static ifeq ($(FLAG_DO_PROFILE), true) $(warning Making profiling version of native library) - LOCAL_SHARED_LIBRARIES += libcutils libutils + LOCAL_SHARED_LIBRARIES += liblog else # FLAG_DO_PROFILE ifeq ($(FLAG_DBG), true) $(warning Making debug version of native library) - LOCAL_SHARED_LIBRARIES += libcutils libutils + LOCAL_SHARED_LIBRARIES += liblog endif # FLAG_DBG endif # FLAG_DO_PROFILE diff --git a/native/jni/src/defines.h b/native/jni/src/defines.h index a4086f58d..05b997d59 100644 --- a/native/jni/src/defines.h +++ b/native/jni/src/defines.h @@ -19,9 +19,12 @@ #define LATINIME_DEFINES_H #if defined(FLAG_DO_PROFILE) || defined(FLAG_DBG) -#include <cutils/log.h> -#define AKLOGE ALOGE -#define AKLOGI ALOGI +#include <android/log.h> +#ifndef LOG_TAG +#define LOG_TAG "LatinIME: " +#endif +#define AKLOGE(fmt, ...) __android_log_print(ANDROID_LOG_ERROR, LOG_TAG, fmt, ##__VA_ARGS__) +#define AKLOGI(fmt, ...) __android_log_print(ANDROID_LOG_INFO, LOG_TAG, fmt, ##__VA_ARGS__) #define DUMP_WORD(word, length) do { dumpWord(word, length); } while(0) #define DUMP_WORD_INT(word, length) do { dumpWordInt(word, length); } while(0) @@ -116,10 +119,6 @@ static inline void prof_out(void) { #endif // FLAG_DO_PROFILE #ifdef FLAG_DBG -#include <cutils/log.h> -#ifndef LOG_TAG -#define LOG_TAG "LatinIME: " -#endif #define DEBUG_DICT true #define DEBUG_DICT_FULL false #define DEBUG_EDIT_DISTANCE false @@ -146,7 +145,6 @@ static inline void prof_out(void) { #define DEBUG_CORRECTION_FREQ false #define DEBUG_WORDS_PRIORITY_QUEUE false - #endif // FLAG_DBG #ifndef U_SHORT_MAX |