mirror of
https://github.com/team-infusion-developers/android_device_samsung_msm8976-common.git
synced 2024-11-07 06:19:20 +00:00
msm8976-common: gps: LOC logging macro changes
The current logging macro always uses LOGE, which is confusing to external developer looking at our logs. Also changed LOC_LOGx definition to follow the same syntax as that of LOC_LOGX. Bug: 29499503 CRs-Fixed: 1113702 Test: marlin Change-Id: I803233a9d0b241bf9aeb2ee0d4bd2e7cc52ed75b Merged-In: I803233a9d0b241bf9aeb2ee0d4bd2e7cc52ed75b Signed-off-by: Iliyan Malchev <malchev@google.com>
This commit is contained in:
parent
c04ca9cbbc
commit
1614ac4d55
1 changed files with 14 additions and 51 deletions
|
@ -81,8 +81,6 @@ extern const char FROM_MODEM[];
|
||||||
extern const char TO_AFW[];
|
extern const char TO_AFW[];
|
||||||
extern const char EXIT_TAG[];
|
extern const char EXIT_TAG[];
|
||||||
extern const char ENTRY_TAG[];
|
extern const char ENTRY_TAG[];
|
||||||
extern const char EXIT_ERROR_TAG[];
|
|
||||||
|
|
||||||
/*=============================================================================
|
/*=============================================================================
|
||||||
*
|
*
|
||||||
* MODULE EXPORTED FUNCTIONS
|
* MODULE EXPORTED FUNCTIONS
|
||||||
|
@ -99,46 +97,24 @@ extern char* get_timestamp(char* str, unsigned long buf_size);
|
||||||
provide a value and we default to the initial value to use
|
provide a value and we default to the initial value to use
|
||||||
Android's logging levels*/
|
Android's logging levels*/
|
||||||
#define IF_LOC_LOGE if((loc_logger.DEBUG_LEVEL >= 1) && (loc_logger.DEBUG_LEVEL <= 5))
|
#define IF_LOC_LOGE if((loc_logger.DEBUG_LEVEL >= 1) && (loc_logger.DEBUG_LEVEL <= 5))
|
||||||
|
|
||||||
#define IF_LOC_LOGW if((loc_logger.DEBUG_LEVEL >= 2) && (loc_logger.DEBUG_LEVEL <= 5))
|
#define IF_LOC_LOGW if((loc_logger.DEBUG_LEVEL >= 2) && (loc_logger.DEBUG_LEVEL <= 5))
|
||||||
|
|
||||||
#define IF_LOC_LOGI if((loc_logger.DEBUG_LEVEL >= 3) && (loc_logger.DEBUG_LEVEL <= 5))
|
#define IF_LOC_LOGI if((loc_logger.DEBUG_LEVEL >= 3) && (loc_logger.DEBUG_LEVEL <= 5))
|
||||||
|
|
||||||
#define IF_LOC_LOGD if((loc_logger.DEBUG_LEVEL >= 4) && (loc_logger.DEBUG_LEVEL <= 5))
|
#define IF_LOC_LOGD if((loc_logger.DEBUG_LEVEL >= 4) && (loc_logger.DEBUG_LEVEL <= 5))
|
||||||
|
|
||||||
#define IF_LOC_LOGV if((loc_logger.DEBUG_LEVEL >= 5) && (loc_logger.DEBUG_LEVEL <= 5))
|
#define IF_LOC_LOGV if((loc_logger.DEBUG_LEVEL >= 5) && (loc_logger.DEBUG_LEVEL <= 5))
|
||||||
|
|
||||||
#define LOC_LOGE(...) \
|
#define LOC_LOGE(...) IF_LOC_LOGE { ALOGE(__VA_ARGS__); }
|
||||||
IF_LOC_LOGE { ALOGE("E/" __VA_ARGS__); } \
|
#define LOC_LOGW(...) IF_LOC_LOGW { ALOGW(__VA_ARGS__); }
|
||||||
else if (loc_logger.DEBUG_LEVEL == 0xff) { ALOGE("E/" __VA_ARGS__); }
|
#define LOC_LOGI(...) IF_LOC_LOGI { ALOGI(__VA_ARGS__); }
|
||||||
|
#define LOC_LOGD(...) IF_LOC_LOGD { ALOGD(__VA_ARGS__); }
|
||||||
#define LOC_LOGW(...) \
|
#define LOC_LOGV(...) IF_LOC_LOGV { ALOGV(__VA_ARGS__); }
|
||||||
IF_LOC_LOGW { ALOGE("W/" __VA_ARGS__); } \
|
|
||||||
else if (loc_logger.DEBUG_LEVEL == 0xff) { ALOGW("W/" __VA_ARGS__); }
|
|
||||||
|
|
||||||
#define LOC_LOGI(...) \
|
|
||||||
IF_LOC_LOGI { ALOGE("I/" __VA_ARGS__); } \
|
|
||||||
else if (loc_logger.DEBUG_LEVEL == 0xff) { ALOGI("I/" __VA_ARGS__); }
|
|
||||||
|
|
||||||
#define LOC_LOGD(...) \
|
|
||||||
IF_LOC_LOGD { ALOGE("D/" __VA_ARGS__); } \
|
|
||||||
else if (loc_logger.DEBUG_LEVEL == 0xff) { ALOGD("D/" __VA_ARGS__); }
|
|
||||||
|
|
||||||
#define LOC_LOGV(...) \
|
|
||||||
IF_LOC_LOGV { ALOGE("V/" __VA_ARGS__); } \
|
|
||||||
else if (loc_logger.DEBUG_LEVEL == 0xff) { ALOGV("V/" __VA_ARGS__); }
|
|
||||||
|
|
||||||
#else /* DEBUG_DMN_LOC_API */
|
#else /* DEBUG_DMN_LOC_API */
|
||||||
|
|
||||||
#define LOC_LOGE(...) ALOGE("E/" __VA_ARGS__)
|
#define LOC_LOGE(...) ALOGE(__VA_ARGS__)
|
||||||
|
#define LOC_LOGW(...) ALOGW(__VA_ARGS__)
|
||||||
#define LOC_LOGW(...) ALOGW("W/" __VA_ARGS__)
|
#define LOC_LOGI(...) ALOGI(__VA_ARGS__)
|
||||||
|
#define LOC_LOGD(...) ALOGD(__VA_ARGS__)
|
||||||
#define LOC_LOGI(...) ALOGI("I/" __VA_ARGS__)
|
#define LOC_LOGV(...) ALOGV(__VA_ARGS__)
|
||||||
|
|
||||||
#define LOC_LOGD(...) ALOGD("D/" __VA_ARGS__)
|
|
||||||
|
|
||||||
#define LOC_LOGV(...) ALOGV("V/" __VA_ARGS__)
|
|
||||||
|
|
||||||
#endif /* DEBUG_DMN_LOC_API */
|
#endif /* DEBUG_DMN_LOC_API */
|
||||||
|
|
||||||
|
@ -159,32 +135,19 @@ else if (loc_logger.DEBUG_LEVEL == 0xff) { ALOGV("V/" __VA_ARGS__); }
|
||||||
} \
|
} \
|
||||||
} while(0)
|
} while(0)
|
||||||
|
|
||||||
#define LOC_LOG_HEAD(tag,fmt) "%s:%d][" tag "] " fmt "\n"
|
|
||||||
#define LOC_LOGv(tag,fmt,...) LOC_LOGV(LOC_LOG_HEAD(tag,fmt), __func__, __LINE__, ##__VA_ARGS__)
|
|
||||||
#define LOC_LOGw(tag,fmt,...) LOC_LOGW(LOC_LOG_HEAD(tag,fmt), __func__, __LINE__, ##__VA_ARGS__)
|
|
||||||
#define LOC_LOGd(tag,fmt,...) LOC_LOGD(LOC_LOG_HEAD(tag,fmt), __func__, __LINE__, ##__VA_ARGS__)
|
|
||||||
#define LOC_LOGe(tag,fmt,...) LOC_LOGE(LOC_LOG_HEAD(tag,fmt), __func__, __LINE__, ##__VA_ARGS__)
|
|
||||||
|
|
||||||
#define LOG_I(ID, WHAT, SPEC, VAL) LOG_(LOC_LOGI, ID, WHAT, SPEC, VAL)
|
#define LOG_I(ID, WHAT, SPEC, VAL) LOG_(LOC_LOGI, ID, WHAT, SPEC, VAL)
|
||||||
#define LOG_V(ID, WHAT, SPEC, VAL) LOG_(LOC_LOGV, ID, WHAT, SPEC, VAL)
|
#define LOG_V(ID, WHAT, SPEC, VAL) LOG_(LOC_LOGV, ID, WHAT, SPEC, VAL)
|
||||||
#define LOG_E(ID, WHAT, SPEC, VAL) LOG_(LOC_LOGE, ID, WHAT, SPEC, VAL)
|
|
||||||
|
|
||||||
#define ENTRY_LOG() LOG_V(ENTRY_TAG, __func__, %s, "")
|
#define ENTRY_LOG() LOG_V(ENTRY_TAG, __func__, %s, "")
|
||||||
#define EXIT_LOG(SPEC, VAL) LOG_V(EXIT_TAG, __func__, SPEC, VAL)
|
#define EXIT_LOG(SPEC, VAL) LOG_V(EXIT_TAG, __func__, SPEC, VAL)
|
||||||
#define EXIT_LOG_WITH_ERROR(SPEC, VAL) \
|
|
||||||
if (VAL != 0) { \
|
|
||||||
LOG_E(EXIT_ERROR_TAG, __func__, SPEC, VAL); \
|
|
||||||
} else { \
|
|
||||||
LOG_V(EXIT_TAG, __func__, SPEC, VAL); \
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// Used for logging callflow from Android Framework
|
// Used for logging callflow from Android Framework
|
||||||
#define ENTRY_LOG_CALLFLOW() LOG_I(FROM_AFW, __func__, %s, "")
|
#define ENTRY_LOG_CALLFLOW() LOG_I(FROM_AFW, __FUNCTION__, %s, "")
|
||||||
// Used for logging callflow to Modem
|
// Used for logging callflow to Modem
|
||||||
#define EXIT_LOG_CALLFLOW(SPEC, VAL) LOG_I(TO_MODEM, __func__, SPEC, VAL)
|
#define EXIT_LOG_CALLFLOW(SPEC, VAL) LOG_I(TO_MODEM, __FUNCTION__, SPEC, VAL)
|
||||||
// Used for logging callflow from Modem(TO_MODEM, __func__, %s, "")
|
// Used for logging callflow from Modem(TO_MODEM, __FUNCTION__, %s, "")
|
||||||
#define MODEM_LOG_CALLFLOW(SPEC, VAL) LOG_I(FROM_MODEM, __func__, SPEC, VAL)
|
#define MODEM_LOG_CALLFLOW(SPEC, VAL) LOG_I(FROM_MODEM, __FUNCTION__, SPEC, VAL)
|
||||||
// Used for logging callflow to Android Framework
|
// Used for logging callflow to Android Framework
|
||||||
#define CALLBACK_LOG_CALLFLOW(CB, SPEC, VAL) LOG_I(TO_AFW, CB, SPEC, VAL)
|
#define CALLBACK_LOG_CALLFLOW(CB, SPEC, VAL) LOG_I(TO_AFW, CB, SPEC, VAL)
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue