Merge "Add an easy way to output native debug logs"

main
satok 2010-11-30 23:02:11 -08:00 committed by Android (Google) Code Review
commit 09e880c6ba
2 changed files with 21 additions and 4 deletions

View File

@ -8,11 +8,22 @@ LOCAL_SRC_FILES := \
src/dictionary.cpp \ src/dictionary.cpp \
src/char_utils.cpp src/char_utils.cpp
#FLAG_DBG := true
ifneq ($(FLAG_DBG), true)
LOCAL_NDK_VERSION := 4 LOCAL_NDK_VERSION := 4
endif
LOCAL_SDK_VERSION := 8 LOCAL_SDK_VERSION := 8
LOCAL_MODULE := libjni_latinime LOCAL_MODULE := libjni_latinime
LOCAL_MODULE_TAGS := user 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) include $(BUILD_SHARED_LIBRARY)

View File

@ -19,15 +19,20 @@
#include <fcntl.h> #include <fcntl.h>
#include <sys/mman.h> #include <sys/mman.h>
#include <string.h> #include <string.h>
//#define LOG_TAG "dictionary.cpp"
//#include <cutils/log.h> #ifdef FLAG_DBG
#define LOG_TAG "LatinIME: dictionary.cpp"
#include <cutils/log.h>
#define DEBUG_DICT 1
#else // FLAG_DBG
#define LOGI #define LOGI
#define DEBUG_DICT 0
#endif // FLAG_DBG
#include "dictionary.h" #include "dictionary.h"
#include "basechars.h" #include "basechars.h"
#include "char_utils.h" #include "char_utils.h"
#define DEBUG_DICT 0
#define DICTIONARY_VERSION_MIN 200 #define DICTIONARY_VERSION_MIN 200
#define DICTIONARY_HEADER_SIZE 2 #define DICTIONARY_HEADER_SIZE 2
#define NOT_VALID_WORD -99 #define NOT_VALID_WORD -99
@ -36,6 +41,7 @@ namespace latinime {
Dictionary::Dictionary(void *dict, int typedLetterMultiplier, int fullWordMultiplier) Dictionary::Dictionary(void *dict, int typedLetterMultiplier, int fullWordMultiplier)
{ {
LOGI("Dictionary - constructor");
mDict = (unsigned char*) dict; mDict = (unsigned char*) dict;
mTypedLetterMultiplier = typedLetterMultiplier; mTypedLetterMultiplier = typedLetterMultiplier;
mFullWordMultiplier = fullWordMultiplier; mFullWordMultiplier = fullWordMultiplier;