[Android] How to Enable LOGV?

In the system/core/include/cutils/log.h

It defines the logging macro and tell us how to enable the logger.

We should concern three conditions,

1. For a single file:

You should define LOG_NDEBUG in top of the file,

    #define LOG_NDEBUG 0

In addition, you can define the LOG_TAG to specify the module name.

2. For a Library:

You should define the symbol in the LOCAL_CFLAGS in the Android.mk,

    LOCAL_CFLAGS += -DLOG_NDEBUG=0

3. For the multiple files:

You should define the symbol in the COMMON_GLOBAL_CFLAGS in the device/{DEVICE}/BoardConfig.mk,

    COMMON_GLOBAL_CFLAGS += -DLOG_NDEBUG=0

發佈留言