如何打开Native层的LOGV

来源:互联网 发布:微信运动数据来源 编辑:程序博客网 时间:2024/05/20 07:19
 要打开所有级别的注释(LOGE, LOGI, LOGD, LOGV, LOGW),只需要在你的cpp代码前加上
?
1
#define LOG_NDEBUG 0

这个是为什么呢?阅读源码
源码目录/system/core/include/cutils/log.h 
可以看到注释
?
1
2
3
4
5
6
7
8
9
10
11
12
/*
 * Normally we strip LOGV (VERBOSE messages) from release builds.
 * You can modify this (for example with "#define LOG_NDEBUG 0"
 * at the top of your source file) to change that behavior.
 */
#ifndef LOG_NDEBUG
#ifdef NDEBUG
#define LOG_NDEBUG 1
#else
#define LOG_NDEBUG 0
#endif
#endif


2. 
特别的,对webkit来说,在DebugFlags.java上可以打开java层的代码
原创粉丝点击