Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 66b68757 authored by Steve Block's avatar Steve Block
Browse files

Rename (IF_)LOGV(_IF) to (IF_)ALOGV(_IF)

Change-Id: Ia9a357dec5ad12eea93fd03401a3b02b38e4e94f
parent 61fbcbe9
Loading
Loading
Loading
Loading
+22 −13
Original line number Diff line number Diff line
@@ -47,7 +47,7 @@ extern "C" {
// ---------------------------------------------------------------------

/*
 * Normally we strip LOGV (VERBOSE messages) from release builds.
 * Normally we strip ALOGV (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.
 */
@@ -73,27 +73,33 @@ extern "C" {
/*
 * Simplified macro to send a verbose log message using the current LOG_TAG.
 */
#ifndef LOGV
#ifndef ALOGV
#if LOG_NDEBUG
#define LOGV(...)   ((void)0)
#define ALOGV(...)   ((void)0)
#else
#define LOGV(...) ((void)ALOG(LOG_VERBOSE, LOG_TAG, __VA_ARGS__))
#define ALOGV(...) ((void)ALOG(LOG_VERBOSE, LOG_TAG, __VA_ARGS__))
#endif
// Temporary measure for code still using old LOG macros.
#ifndef LOGV
#define LOGV ALOGV
#endif
#define ALOGV LOGV
#endif

#define CONDITION(cond)     (__builtin_expect((cond)!=0, 0))

#ifndef LOGV_IF
#ifndef ALOGV_IF
#if LOG_NDEBUG
#define LOGV_IF(cond, ...)   ((void)0)
#define ALOGV_IF(cond, ...)   ((void)0)
#else
#define LOGV_IF(cond, ...) \
#define ALOGV_IF(cond, ...) \
    ( (CONDITION(cond)) \
    ? ((void)ALOG(LOG_VERBOSE, LOG_TAG, __VA_ARGS__)) \
    : (void)0 )
#endif
#define ALOGV_IF LOGV_IF
// Temporary measure for code still using old LOG macros.
#ifndef LOGV_IF
#define LOGV_IF ALOGV_IF
#endif
#endif

/*
@@ -166,13 +172,16 @@ extern "C" {
 * Conditional based on whether the current LOG_TAG is enabled at
 * verbose priority.
 */
#ifndef IF_LOGV
#ifndef IF_ALOGV
#if LOG_NDEBUG
#define IF_LOGV() if (false)
#define IF_ALOGV() if (false)
#else
#define IF_LOGV() IF_ALOG(LOG_VERBOSE, LOG_TAG)
#define IF_ALOGV() IF_ALOG(LOG_VERBOSE, LOG_TAG)
#endif
// Temporary measure for code still using old LOG macros.
#ifndef IF_LOGV
#define IF_LOGV IF_ALOGV
#endif
#define IF_ALOGV IF_LOGV
#endif

/*
+6 −6
Original line number Diff line number Diff line
@@ -25,13 +25,13 @@
#include <cutils/log.h>
#else
#include <stdio.h>
#define LOG(level, ...) \
#define ALOG(level, ...) \
        ((void)printf("cutils:" level "/" LOG_TAG ": " __VA_ARGS__))
#define LOGV(...)   LOG("V", __VA_ARGS__)
#define LOGD(...)   LOG("D", __VA_ARGS__)
#define LOGI(...)   LOG("I", __VA_ARGS__)
#define LOGW(...)   LOG("W", __VA_ARGS__)
#define LOGE(...)   LOG("E", __VA_ARGS__)
#define ALOGV(...)   ALOG("V", __VA_ARGS__)
#define LOGD(...)   ALOG("D", __VA_ARGS__)
#define LOGI(...)   ALOG("I", __VA_ARGS__)
#define LOGW(...)   ALOG("W", __VA_ARGS__)
#define LOGE(...)   ALOG("E", __VA_ARGS__)
#define LOG_ALWAYS_FATAL(...)   do { LOGE(__VA_ARGS__); exit(1); } while (0)
#endif

+5 −5
Original line number Diff line number Diff line
@@ -130,7 +130,7 @@ static void init(void)
    if (gPropFd < 0) {
        //LOGW("not connected to system property server\n");
    } else {
        //LOGV("Connected to system property server\n");
        //ALOGV("Connected to system property server\n");
    }
}

@@ -140,7 +140,7 @@ int property_get(const char *key, char *value, const char *default_value)
    char recvBuf[1+PROPERTY_VALUE_MAX];
    int len = -1;

    //LOGV("PROPERTY GET [%s]\n", key);
    //ALOGV("PROPERTY GET [%s]\n", key);

    pthread_once(&gInitOnce, init);
    if (gPropFd < 0) {
@@ -194,7 +194,7 @@ int property_get(const char *key, char *value, const char *default_value)
        assert(0);
        return -1;
    }
    //LOGV("PROP [found=%d def='%s'] (%d) [%s]: [%s]\n",
    //ALOGV("PROP [found=%d def='%s'] (%d) [%s]: [%s]\n",
    //    recvBuf[0], default_value, len, key, value);

    return len;
@@ -207,7 +207,7 @@ int property_set(const char *key, const char *value)
    char recvBuf[1];
    int result = -1;

    //LOGV("PROPERTY SET [%s]: [%s]\n", key, value);
    //ALOGV("PROPERTY SET [%s]: [%s]\n", key, value);

    pthread_once(&gInitOnce, init);
    if (gPropFd < 0)
@@ -241,7 +241,7 @@ int property_set(const char *key, const char *value)
int property_list(void (*propfn)(const char *key, const char *value, void *cookie), 
                  void *cookie)
{
    //LOGV("PROPERTY LIST\n");
    //ALOGV("PROPERTY LIST\n");
    pthread_once(&gInitOnce, init);
    if (gPropFd < 0)
        return -1;
+5 −5
Original line number Diff line number Diff line
@@ -60,7 +60,7 @@ void qtaguid_resTrack(void) {
static int write_ctrl(const char *cmd) {
    int fd, res, savedErrno;

    LOGV("write_ctrl(%s)", cmd);
    ALOGV("write_ctrl(%s)", cmd);

    fd = TEMP_FAILURE_RETRY(open(CTRL_PROCPATH, O_WRONLY));
    if (fd < 0) {
@@ -107,7 +107,7 @@ int qtaguid_tagSocket(int sockfd, int tag, uid_t uid) {

    snprintf(lineBuf, sizeof(lineBuf), "t %d %llu %d", sockfd, kTag, uid);

    LOGV("Tagging socket %d with tag %llx{%u,0} for uid %d", sockfd, kTag, tag, uid);
    ALOGV("Tagging socket %d with tag %llx{%u,0} for uid %d", sockfd, kTag, tag, uid);

    res = write_ctrl(lineBuf);
    if (res < 0) {
@@ -122,7 +122,7 @@ int qtaguid_untagSocket(int sockfd) {
    char lineBuf[CTRL_MAX_INPUT_LEN];
    int res;

    LOGV("Untagging socket %d", sockfd);
    ALOGV("Untagging socket %d", sockfd);

    snprintf(lineBuf, sizeof(lineBuf), "u %d", sockfd);
    res = write_ctrl(lineBuf);
@@ -137,7 +137,7 @@ int qtaguid_setCounterSet(int counterSetNum, uid_t uid) {
    char lineBuf[CTRL_MAX_INPUT_LEN];
    int res;

    LOGV("Setting counters to set %d for uid %d", counterSetNum, uid);
    ALOGV("Setting counters to set %d for uid %d", counterSetNum, uid);

    snprintf(lineBuf, sizeof(lineBuf), "s %d %d", counterSetNum, uid);
    res = write_ctrl(lineBuf);
@@ -149,7 +149,7 @@ int qtaguid_deleteTagData(int tag, uid_t uid) {
    int fd, cnt = 0, res = 0;
    uint64_t kTag = (uint64_t)tag << 32;

    LOGV("Deleting tag data with tag %llx{%d,0} for uid %d", kTag, tag, uid);
    ALOGV("Deleting tag data with tag %llx{%d,0} for uid %d", kTag, tag, uid);

    pthread_once(&resTrackInitDone, qtaguid_resTrack);

+2 −2
Original line number Diff line number Diff line
@@ -103,7 +103,7 @@ struct str_parms *str_parms_create_str(const char *_string)
    if (!str)
        goto err_strdup;

    LOGV("%s: source string == '%s'\n", __func__, _string);
    ALOGV("%s: source string == '%s'\n", __func__, _string);

    kvpair = strtok_r(str, ";", &tmpstr);
    while (kvpair && *kvpair) {
@@ -137,7 +137,7 @@ next_pair:
    }

    if (!items)
        LOGV("%s: no items found in string\n", __func__);
        ALOGV("%s: no items found in string\n", __func__);

    free(str);

Loading