[Android] JNI Debugging
Add to Android.mk
Add to C/C++ file
Usage
The log(logcat) will be
04-21 17:46:00.121 D 10000 Jackal 0x1 messages.
LOCAL_LDLIBS := -L$(SYSROOT)/usr/lib -llog
Add to C/C++ file
#include <android/log.h>
#define LOG_TAG "Jackal"
#define LOGV(...) __android_log_print(ANDROID_LOG_VERBOSE, LOG_TAG, __VA_ARGS__)
#define LOGD(...) __android_log_print(ANDROID_LOG_DEBUG , LOG_TAG, __VA_ARGS__)
#define LOGI(...) __android_log_print(ANDROID_LOG_INFO , LOG_TAG, __VA_ARGS__)
#define LOGW(...) __android_log_print(ANDROID_LOG_WARN , LOG_TAG, __VA_ARGS__)
#define LOGE(...) __android_log_print(ANDROID_LOG_ERROR , LOG_TAG, __VA_ARGS__)
Usage
LOGD("0x%x messages.", msgCnt);
The log(logcat) will be
04-21 17:46:00.121 D 10000 Jackal 0x1 messages.
留言