Rename (IF_)LOGI(_IF) to (IF_)ALOGI(_IF) DO NOT MERGE

Bug: 5449033
Change-Id: I4951baa981f09a84ce483e3d1bd0f9ebe009035f
This commit is contained in:
Steve Block 2012-01-04 19:19:03 +00:00
parent 8d66c49258
commit fe71a61e5b
15 changed files with 38 additions and 38 deletions

View File

@ -111,12 +111,12 @@ extern "C" {
/*
* Simplified macro to send an info log message using the current LOG_TAG.
*/
#ifndef LOGI
#define LOGI(...) ((void)ALOG(LOG_INFO, LOG_TAG, __VA_ARGS__))
#ifndef ALOGI
#define ALOGI(...) ((void)ALOG(LOG_INFO, LOG_TAG, __VA_ARGS__))
#endif
#ifndef LOGI_IF
#define LOGI_IF(cond, ...) \
#ifndef ALOGI_IF
#define ALOGI_IF(cond, ...) \
( (CONDITION(cond)) \
? ((void)ALOG(LOG_INFO, LOG_TAG, __VA_ARGS__)) \
: (void)0 )
@ -176,8 +176,8 @@ extern "C" {
* Conditional based on whether the current LOG_TAG is enabled at
* info priority.
*/
#ifndef IF_LOGI
#define IF_LOGI() IF_ALOG(LOG_INFO, LOG_TAG)
#ifndef IF_ALOGI
#define IF_ALOGI() IF_ALOG(LOG_INFO, LOG_TAG)
#endif
/*

View File

@ -29,7 +29,7 @@
((void)printf("cutils:" level "/" LOG_TAG ": " __VA_ARGS__))
#define ALOGV(...) ALOG("V", __VA_ARGS__)
#define ALOGD(...) ALOG("D", __VA_ARGS__)
#define LOGI(...) ALOG("I", __VA_ARGS__)
#define ALOGI(...) 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)

View File

@ -374,10 +374,10 @@ static bool peerProxyRemoveConnection(void* key, void* value, void* context) {
*/
static void peerProxyKill(PeerProxy* peerProxy, bool errnoIsSet) {
if (errnoIsSet) {
LOGI("Peer %d died. errno: %s", peerProxy->credentials.pid,
ALOGI("Peer %d died. errno: %s", peerProxy->credentials.pid,
strerror(errno));
} else {
LOGI("Peer %d died.", peerProxy->credentials.pid);
ALOGI("Peer %d died.", peerProxy->credentials.pid);
}
// If we lost the master, we're up a creek. We can't let this happen.
@ -902,7 +902,7 @@ static void masterProxyHandleConnectionError(PeerProxy* masterProxy,
peerUnlock(peer);
if (peerProxy != NULL) {
LOGI("Couldn't connect to %d.", pid);
ALOGI("Couldn't connect to %d.", pid);
peerProxyKill(peerProxy, false);
} else {
LOGW("Peer proxy for %d not found. This shouldn't happen.", pid);
@ -947,7 +947,7 @@ static bool peerProxyBufferInput(PeerProxy* peerProxy) {
return false;
} else if (size == 0) {
// EOF.
LOGI("EOF");
ALOGI("EOF");
peerProxyKill(peerProxy, false);
return false;
} else if (bufferReadComplete(in)) {
@ -1050,7 +1050,7 @@ static void masterAcceptConnection(SelectableFd* listenerFd) {
credentials.uid = ucredentials.uid;
credentials.gid = ucredentials.gid;
LOGI("Accepted connection from process %d.", credentials.pid);
ALOGI("Accepted connection from process %d.", credentials.pid);
Peer* masterPeer = (Peer*) listenerFd->data;

View File

@ -74,7 +74,7 @@ static int write_ctrl(const char *cmd) {
savedErrno = 0;
}
if (res < 0) {
LOGI("Failed write_ctrl(%s) res=%d errno=%d", cmd, res, savedErrno);
ALOGI("Failed write_ctrl(%s) res=%d errno=%d", cmd, res, savedErrno);
}
close(fd);
return -savedErrno;
@ -111,7 +111,7 @@ int qtaguid_tagSocket(int sockfd, int tag, uid_t uid) {
res = write_ctrl(lineBuf);
if (res < 0) {
LOGI("Tagging socket %d with tag %llx(%d) for uid %d failed errno=%d",
ALOGI("Tagging socket %d with tag %llx(%d) for uid %d failed errno=%d",
sockfd, kTag, tag, uid, res);
}
@ -127,7 +127,7 @@ int qtaguid_untagSocket(int sockfd) {
snprintf(lineBuf, sizeof(lineBuf), "u %d", sockfd);
res = write_ctrl(lineBuf);
if (res < 0) {
LOGI("Untagging socket %d failed errno=%d", sockfd, res);
ALOGI("Untagging socket %d failed errno=%d", sockfd, res);
}
return res;
@ -156,7 +156,7 @@ int qtaguid_deleteTagData(int tag, uid_t uid) {
snprintf(lineBuf, sizeof(lineBuf), "d %llu %d", kTag, uid);
res = write_ctrl(lineBuf);
if (res < 0) {
LOGI("Deleteing tag data with tag %llx/%d for uid %d failed with cnt=%d errno=%d",
ALOGI("Deleteing tag data with tag %llx/%d for uid %d failed with cnt=%d errno=%d",
kTag, tag, uid, cnt, errno);
}

View File

@ -48,7 +48,7 @@ static void eatWakeupData(SelectableFd* wakeupFd) {
static char garbage[64];
if (read(wakeupFd->fd, garbage, sizeof(garbage)) < 0) {
if (errno == EINTR) {
LOGI("read() interrupted.");
ALOGI("read() interrupted.");
} else {
LOG_ALWAYS_FATAL("This should never happen: %s", strerror(errno));
}
@ -77,7 +77,7 @@ void selectorWakeUp(Selector* selector) {
static char garbage[1];
if (write(selector->wakeupPipe[1], garbage, sizeof(garbage)) < 0) {
if (errno == EINTR) {
LOGI("read() interrupted.");
ALOGI("read() interrupted.");
} else {
LOG_ALWAYS_FATAL("This should never happen: %s", strerror(errno));
}
@ -251,7 +251,7 @@ void selectorLoop(Selector* selector) {
if (result == -1) {
// Abort on everything except EINTR.
if (errno == EINTR) {
LOGI("select() interrupted.");
ALOGI("select() interrupted.");
} else {
LOG_ALWAYS_FATAL("select() error: %s",
strerror(errno));

View File

@ -281,7 +281,7 @@ char *str_parms_to_str(struct str_parms *str_parms)
static bool dump_entry(void *key, void *value, void *context)
{
LOGI("key: '%s' value: '%s'\n", (char *)key, (char *)value);
ALOGI("key: '%s' value: '%s'\n", (char *)key, (char *)value);
return true;
}
@ -301,7 +301,7 @@ static void test_str_parms_str(const char *str)
str_parms_dump(str_parms);
out_str = str_parms_to_str(str_parms);
str_parms_destroy(str_parms);
LOGI("%s: '%s' stringified is '%s'", __func__, str, out_str);
ALOGI("%s: '%s' stringified is '%s'", __func__, str, out_str);
free(out_str);
}

View File

@ -47,7 +47,7 @@ cfg_pentry(struct pc_partition *pentry, uint8_t status, uint8_t type,
pentry->start_lba = start;
pentry->len_lba = len;
LOGI("Configuring pentry. status=0x%x type=0x%x start_lba=%u len_lba=%u",
ALOGI("Configuring pentry. status=0x%x type=0x%x start_lba=%u len_lba=%u",
pentry->status, pentry->type, pentry->start_lba, pentry->len_lba);
}

View File

@ -319,7 +319,7 @@ validate(struct disk_info *dinfo)
} else
disk_size = (uint64_t)dinfo->num_lba * (uint64_t)dinfo->sect_size;
} else if (S_ISREG(stat.st_mode)) {
LOGI("Requesting operation on a regular file, not block device.");
ALOGI("Requesting operation on a regular file, not block device.");
if (!dinfo->sect_size) {
LOGE("Sector size for regular file images cannot be zero");
goto fail;

View File

@ -40,7 +40,7 @@ write_raw_image(const char *dst, const char *src, loff_t offset, int test)
int done = 0;
uint64_t total = 0;
LOGI("Writing RAW image '%s' to '%s' (offset=%llu)", src, dst, offset);
ALOGI("Writing RAW image '%s' to '%s' (offset=%llu)", src, dst, offset);
if ((src_fd = open(src, O_RDONLY)) < 0) {
LOGE("Could not open %s for reading (errno=%d).", src, errno);
goto fail;
@ -101,7 +101,7 @@ write_raw_image(const char *dst, const char *src, loff_t offset, int test)
if (dst_fd >= 0)
fsync(dst_fd);
LOGI("Wrote %llu bytes to %s @ %lld", total, dst, offset);
ALOGI("Wrote %llu bytes to %s @ %lld", total, dst, offset);
close(src_fd);
if (dst_fd >= 0)

View File

@ -82,7 +82,7 @@ wlist_commit(int fd, struct write_list *lst, int test)
goto fail;
}
} else
LOGI("Would write %d bytes @ offset %lld.", lst->len, lst->offset);
ALOGI("Would write %d bytes @ offset %lld.", lst->len, lst->offset);
}
return 0;

View File

@ -177,7 +177,7 @@ int ARMAssembler::generate(const char* name)
// the instruction cache is flushed by CodeCache
const int64_t duration = ggl_system_time() - mDuration;
const char * const format = "generated %s (%d ins) at [%p:%p] in %lld ns\n";
LOGI(format, name, int(pc()-base()), base(), pc(), duration);
ALOGI(format, name, int(pc()-base()), base(), pc(), duration);
#if defined(WITH_LIB_HARDWARE)
if (__builtin_expect(mQemuTracing, 0)) {

View File

@ -351,7 +351,7 @@ static void pick_scanline(context_t* c)
}
#if DEBUG_NEEDS
LOGI("Needs: n=0x%08x p=0x%08x t0=0x%08x t1=0x%08x",
ALOGI("Needs: n=0x%08x p=0x%08x t0=0x%08x t1=0x%08x",
c->state.needs.n, c->state.needs.p,
c->state.needs.t[0], c->state.needs.t[1]);
#endif
@ -395,7 +395,7 @@ static void pick_scanline(context_t* c)
c->scanline_as->decStrong(c);
}
//LOGI("using generated pixel-pipeline");
//ALOGI("using generated pixel-pipeline");
c->scanline_as = assembly.get();
c->scanline_as->incStrong(c); // hold on to assembly
c->scanline = (void(*)(context_t* c))assembly->base();

View File

@ -639,7 +639,7 @@ struct Edge
static void
edge_dump( Edge* edge )
{
LOGI( " top=%d (%.3f) bot=%d (%.3f) x=%d (%.3f) ix=%d (%.3f)",
ALOGI( " top=%d (%.3f) bot=%d (%.3f) x=%d (%.3f) ix=%d (%.3f)",
edge->y_top, edge->y_top/float(TRI_ONE),
edge->y_bot, edge->y_bot/float(TRI_ONE),
edge->x, edge->x/float(FIXED_ONE),
@ -650,7 +650,7 @@ static void
triangle_dump_edges( Edge* edges,
int count )
{
LOGI( "%d edge%s:\n", count, count == 1 ? "" : "s" );
ALOGI( "%d edge%s:\n", count, count == 1 ? "" : "s" );
for ( ; count > 0; count--, edges++ )
edge_dump( edges );
}

View File

@ -108,7 +108,7 @@ int WifiController::stop() {
int WifiController::enable() {
if (!isPoweredUp()) {
LOGI("Powering up");
ALOGI("Powering up");
sendStatusBroadcast("Powering up WiFi hardware");
if (powerUp()) {
LOGE("Powerup failed (%s)", strerror(errno));
@ -117,7 +117,7 @@ int WifiController::enable() {
}
if (mModuleName[0] != '\0' && !isKernelModuleLoaded(mModuleName)) {
LOGI("Loading driver");
ALOGI("Loading driver");
sendStatusBroadcast("Loading WiFi driver");
if (loadKernelModule(mModulePath, mModuleArgs)) {
LOGE("Kernel module load failed (%s)", strerror(errno));
@ -126,7 +126,7 @@ int WifiController::enable() {
}
if (!isFirmwareLoaded()) {
LOGI("Loading firmware");
ALOGI("Loading firmware");
sendStatusBroadcast("Loading WiFI firmware");
if (loadFirmware()) {
LOGE("Firmware load failed (%s)", strerror(errno));
@ -135,7 +135,7 @@ int WifiController::enable() {
}
if (!mSupplicant->isStarted()) {
LOGI("Starting WPA Supplicant");
ALOGI("Starting WPA Supplicant");
sendStatusBroadcast("Starting WPA Supplicant");
if (mSupplicant->start()) {
LOGE("Supplicant start failed (%s)", strerror(errno));
@ -167,7 +167,7 @@ int WifiController::enable() {
mPropMngr->attachProperty("wifi", mDynamicProperties.propNetCount);
mPropMngr->attachProperty("wifi", mDynamicProperties.propTriggerScan);
LOGI("Enabled successfully");
ALOGI("Enabled successfully");
return 0;
out_unloadmodule:

View File

@ -28,7 +28,7 @@
#include "TiwlanWifiController.h"
int main() {
LOGI("Nexus version 0.1 firing up");
ALOGI("Nexus version 0.1 firing up");
CommandListener *cl = new CommandListener();
@ -62,6 +62,6 @@ int main() {
sleep(1000);
}
LOGI("Nexus exiting");
ALOGI("Nexus exiting");
exit(0);
}