From 15dc33d9f6ab9b0321f35be495a1a2c6a665ca85 Mon Sep 17 00:00:00 2001 From: satok Date: Wed, 1 Dec 2010 15:37:31 +0900 Subject: [PATCH] Add an easy way to output native debug logs Change-Id: Ieff2b8e60c5e7dedb7f86e17f7c37b349a912ab4 --- native/Android.mk | 13 ++++++++++++- native/src/dictionary.cpp | 12 +++++++++--- 2 files changed, 21 insertions(+), 4 deletions(-) diff --git a/native/Android.mk b/native/Android.mk index b2944699c..97051c92f 100644 --- a/native/Android.mk +++ b/native/Android.mk @@ -8,11 +8,22 @@ LOCAL_SRC_FILES := \ src/dictionary.cpp \ src/char_utils.cpp -LOCAL_NDK_VERSION := 4 +#FLAG_DBG := true + +ifneq ($(FLAG_DBG), true) + LOCAL_NDK_VERSION := 4 +endif + LOCAL_SDK_VERSION := 8 LOCAL_MODULE := libjni_latinime LOCAL_MODULE_TAGS := user +ifeq ($(FLAG_DBG), true) + $(warning "Making debug build.") + LOCAL_CFLAGS += -DFLAG_DBG + LOCAL_SHARED_LIBRARIES := libcutils libutils +endif + include $(BUILD_SHARED_LIBRARY) diff --git a/native/src/dictionary.cpp b/native/src/dictionary.cpp index 1a39f585b4..7f58fc137 100644 --- a/native/src/dictionary.cpp +++ b/native/src/dictionary.cpp @@ -19,15 +19,20 @@ #include #include #include -//#define LOG_TAG "dictionary.cpp" -//#include + +#ifdef FLAG_DBG +#define LOG_TAG "LatinIME: dictionary.cpp" +#include +#define DEBUG_DICT 1 +#else // FLAG_DBG #define LOGI +#define DEBUG_DICT 0 +#endif // FLAG_DBG #include "dictionary.h" #include "basechars.h" #include "char_utils.h" -#define DEBUG_DICT 0 #define DICTIONARY_VERSION_MIN 200 #define DICTIONARY_HEADER_SIZE 2 #define NOT_VALID_WORD -99 @@ -36,6 +41,7 @@ namespace latinime { Dictionary::Dictionary(void *dict, int typedLetterMultiplier, int fullWordMultiplier) { + LOGI("Dictionary - constructor"); mDict = (unsigned char*) dict; mTypedLetterMultiplier = typedLetterMultiplier; mFullWordMultiplier = fullWordMultiplier;