• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 #ifndef LOCAL_LOG_DEF_H
2 #define LOCAL_LOG_DEF_H
3 
4 /* comment this line if Android OS is ICS and prior */
5 #define ANDROID_VERSION_JB      (1)
6 
7 /* Log enablers, each of these independent */
8 
9 #define PROCESS_VERBOSE (0) /* process log messages */
10 #define EXTRA_VERBOSE   (0) /* verbose log messages */
11 #define SYSFS_VERBOSE   (0) /* log sysfs interactions as cat/echo for repro
12                                purpose on a shell */
13 #define FUNC_ENTRY      (0) /* log entry in all one-time functions */
14 
15 /* Note that enabling this logs may affect performance */
16 #define HANDLER_ENTRY   (0) /* log entry in all handler functions */
17 #define ENG_VERBOSE     (0) /* log some a lot more info about the internals */
18 #define INPUT_DATA      (0) /* log the data input from the events */
19 #define HANDLER_DATA    (0) /* log the data fetched from the handlers */
20 
21 #ifdef ANDROID_VERSION_JB
22 #define LOGV            ALOGV
23 #define LOGV_IF         ALOGV_IF
24 #define LOGD            ALOGD
25 #define LOGD_IF         ALOGD_IF
26 #define LOGI            ALOGI
27 #define LOGI_IF         ALOGI_IF
28 #define LOGW            ALOGW
29 #define LOGW_IF         ALOGW_IF
30 #define LOGE            ALOGE
31 #define LOGE_IF         ALOGE_IF
32 #define IF_LOGV         IF_ALOGV
33 #define IF_LOGD         IF_ALOGD
34 #define IF_LOGI         IF_ALOGI
35 #define IF_LOGW         IF_ALOGW
36 #define IF_LOGE         IF_ALOGE
37 #define LOG_ASSERT      ALOG_ASSERT
38 #define LOG                     ALOG
39 #define IF_LOG          IF_ALOG
40 #endif
41 
42 #define FUNC_LOG \
43             LOGV("%s", __PRETTY_FUNCTION__)
44 #define VFUNC_LOG \
45             LOGV_IF(FUNC_ENTRY, "Entering function '%s'", __PRETTY_FUNCTION__)
46 #define VHANDLER_LOG \
47             LOGV_IF(HANDLER_ENTRY, "Entering handler '%s'", __PRETTY_FUNCTION__)
48 
49 #endif
50