jni log 使用

1. 在源文件中添加头文件
#include <android/log.h>
#define LOG_TAG "System.out.c"
#define LOGD(...) __android_log_print(ANDROID_LOG_DEBUG, LOG_TAG, __VA_ARGS__)
#define LOGI(...) __android_log_print(ANDROID_LOG_INFO, LOG_TAG, __VA_ARGS__)

2. android.mk中添加:
LOCAL_LDLIBS += -llog

4. 使用:
LOGI("find class error");
也可使用
LOGI("find class error=%d", n);




原文地址:https://www.cnblogs.com/lv-2012/p/5d9e106d8eb54221c0ac23e85c53a791.html