Rename (IF_)LOGE(_IF) to (IF_)ALOGE(_IF)

Change-Id: I52fce957db06c281e2618daa4e2ecba19974f2eb
diff --git a/include/cutils/log.h b/include/cutils/log.h
index 4e6a57d..c7543fb 100644
--- a/include/cutils/log.h
+++ b/include/cutils/log.h
@@ -171,17 +171,23 @@
 /*
  * Simplified macro to send an error log message using the current LOG_TAG.
  */
+#ifndef ALOGE
+#define ALOGE(...) ((void)ALOG(LOG_ERROR, LOG_TAG, __VA_ARGS__))
+// Temporary measure for code still using old LOG macros.
 #ifndef LOGE
-#define LOGE(...) ((void)ALOG(LOG_ERROR, LOG_TAG, __VA_ARGS__))
-#define ALOGE LOGE
+#define LOGE ALOGE
+#endif
 #endif
 
-#ifndef LOGE_IF
-#define LOGE_IF(cond, ...) \
+#ifndef ALOGE_IF
+#define ALOGE_IF(cond, ...) \
     ( (CONDITION(cond)) \
     ? ((void)ALOG(LOG_ERROR, LOG_TAG, __VA_ARGS__)) \
     : (void)0 )
-#define ALOGE_IF LOGE_IF
+// Temporary measure for code still using old LOG macros.
+#ifndef LOGE_IF
+#define LOGE_IF ALOGE_IF
+#endif
 #endif
 
 // ---------------------------------------------------------------------
@@ -242,9 +248,12 @@
  * Conditional based on whether the current LOG_TAG is enabled at
  * error priority.
  */
+#ifndef IF_ALOGE
+#define IF_ALOGE() IF_ALOG(LOG_ERROR, LOG_TAG)
+// Temporary measure for code still using old LOG macros.
 #ifndef IF_LOGE
-#define IF_LOGE() IF_ALOG(LOG_ERROR, LOG_TAG)
-#define IF_ALOGE IF_LOGE
+#define IF_LOGE IF_ALOGE
+#endif
 #endif
 
 
diff --git a/libcutils/loghack.h b/libcutils/loghack.h
index 330e1ee..750cab0 100644
--- a/libcutils/loghack.h
+++ b/libcutils/loghack.h
@@ -31,8 +31,8 @@
 #define ALOGD(...)   ALOG("D", __VA_ARGS__)
 #define ALOGI(...)   ALOG("I", __VA_ARGS__)
 #define ALOGW(...)   ALOG("W", __VA_ARGS__)
-#define LOGE(...)   ALOG("E", __VA_ARGS__)
-#define LOG_ALWAYS_FATAL(...)   do { LOGE(__VA_ARGS__); exit(1); } while (0)
+#define ALOGE(...)   ALOG("E", __VA_ARGS__)
+#define LOG_ALWAYS_FATAL(...)   do { ALOGE(__VA_ARGS__); exit(1); } while (0)
 #endif
 
 #endif // _CUTILS_LOGHACK_H
diff --git a/libcutils/properties.c b/libcutils/properties.c
index e29d261..f732ec0 100644
--- a/libcutils/properties.c
+++ b/libcutils/properties.c
@@ -189,7 +189,7 @@
         strcpy(value, recvBuf+1);
         len = strlen(value);
     } else {
-        LOGE("Got strange response to property_get request (%d)\n",
+        ALOGE("Got strange response to property_get request (%d)\n",
             recvBuf[0]);
         assert(0);
         return -1;
diff --git a/libcutils/record_stream.c b/libcutils/record_stream.c
index 274423b..6994904 100644
--- a/libcutils/record_stream.c
+++ b/libcutils/record_stream.c
@@ -144,7 +144,7 @@
         && p_rs->read_end == p_rs->buffer_end
     ) {
         // this should never happen
-        //LOGE("max record length exceeded\n");
+        //ALOGE("max record length exceeded\n");
         assert (0);
         errno = EFBIG;
         return -1;
diff --git a/libcutils/sockets.c b/libcutils/sockets.c
index 101a382..b5a1b3d 100644
--- a/libcutils/sockets.c
+++ b/libcutils/sockets.c
@@ -30,12 +30,12 @@
     int n = getsockopt(fd, SOL_SOCKET, SO_PEERCRED, &cr, &len);
 
     if (n != 0) {
-        LOGE("could not get socket credentials: %s\n", strerror(errno));
+        ALOGE("could not get socket credentials: %s\n", strerror(errno));
         return false;
     }
 
     if ((cr.uid != AID_ROOT) && (cr.uid != AID_SHELL)) {
-        LOGE("untrusted userid on other end of socket: userid %d\n", cr.uid);
+        ALOGE("untrusted userid on other end of socket: userid %d\n", cr.uid);
         return false;
     }
 #endif
diff --git a/libcutils/zygote.c b/libcutils/zygote.c
index aa060c0..75ce3ba 100644
--- a/libcutils/zygote.c
+++ b/libcutils/zygote.c
@@ -46,7 +46,7 @@
 {
 #ifndef HAVE_ANDROID_OS
     // not supported on simulator targets
-    //LOGE("zygote_* not supported on simulator targets");
+    //ALOGE("zygote_* not supported on simulator targets");
     return -1;
 #else /* HAVE_ANDROID_OS */
     uint32_t pid;
diff --git a/libdiskconfig/config_mbr.c b/libdiskconfig/config_mbr.c
index 07bd6a7..703484c 100644
--- a/libdiskconfig/config_mbr.c
+++ b/libdiskconfig/config_mbr.c
@@ -62,7 +62,7 @@
     lba = (lba + (uint64_t)sect_size - 1) & ~((uint64_t)sect_size - 1);
     lba /= (uint64_t)sect_size;
     if (lba >= 0xffffffffULL)
-        LOGE("Error converting kb -> lba. 32bit overflow, expect weirdness");
+        ALOGE("Error converting kb -> lba. 32bit overflow, expect weirdness");
     return (uint32_t)(lba & 0xffffffffULL);
 }
 
@@ -75,12 +75,12 @@
     struct pc_partition *pentry;
 
     if (pnum >= PC_NUM_BOOT_RECORD_PARTS) {
-        LOGE("Maximum number of primary partition exceeded.");
+        ALOGE("Maximum number of primary partition exceeded.");
         return NULL;
     }
 
     if (!(item = alloc_wl(sizeof(struct pc_partition)))) {
-        LOGE("Unable to allocate memory for partition entry.");
+        ALOGE("Unable to allocate memory for partition entry.");
         return NULL;
     }
 
@@ -146,7 +146,7 @@
     uint32_t len; /* in lba units */
 
     if (!(item = alloc_wl(sizeof(struct pc_boot_record)))) {
-        LOGE("Unable to allocate memory for EBR.");
+        ALOGE("Unable to allocate memory for EBR.");
         return NULL;
     }
 
@@ -163,7 +163,7 @@
         len = kb_to_lba(pinfo->len_kb, dinfo->sect_size);
     else {
         if (pnext) {
-            LOGE("Only the last partition can be specified to fill the disk "
+            ALOGE("Only the last partition can be specified to fill the disk "
                  "(name = '%s')", pinfo->name);
             goto fail;
         }
@@ -233,7 +233,7 @@
                 if ((temp_wr = mk_pri_pentry(dinfo, NULL, cnt, &cur_lba)))
                     wlist_add(&wr_list, temp_wr);
                 else {
-                    LOGE("Cannot create primary extended partition.");
+                    ALOGE("Cannot create primary extended partition.");
                     goto fail;
                 }
             }
@@ -259,7 +259,7 @@
         if (temp_wr)
             wlist_add(&wr_list, temp_wr);
         else {
-            LOGE("Cannot create partition %d (%s).", cnt, pinfo->name);
+            ALOGE("Cannot create partition %d (%s).", cnt, pinfo->name);
             goto fail;
         }
     }
@@ -270,7 +270,7 @@
         cur_lba = 0;
         memset(&blank, 0, sizeof(struct part_info));
         if (!(temp_wr = mk_pri_pentry(dinfo, &blank, cnt, &cur_lba))) {
-            LOGE("Cannot create blank partition %d.", cnt);
+            ALOGE("Cannot create blank partition %d.", cnt);
             goto fail;
         }
         wlist_add(&wr_list, temp_wr);
@@ -279,7 +279,7 @@
     return wr_list;
 
 nospace:
-    LOGE("Not enough space to add parttion '%s'.", pinfo->name);
+    ALOGE("Not enough space to add parttion '%s'.", pinfo->name);
 
 fail:
     wlist_free(wr_list);
@@ -310,13 +310,13 @@
         num++;
 
     if (!(dev_name = malloc(MAX_NAME_LEN))) {
-        LOGE("Cannot allocate memory.");
+        ALOGE("Cannot allocate memory.");
         return NULL;
     }
 
     num = snprintf(dev_name, MAX_NAME_LEN, "%s%d", dinfo->device, num);
     if (num >= MAX_NAME_LEN) {
-        LOGE("Device name is too long?!");
+        ALOGE("Device name is too long?!");
         free(dev_name);
         return NULL;
     }
diff --git a/libdiskconfig/diskconfig.c b/libdiskconfig/diskconfig.c
index 66bd0c3..d5425de 100644
--- a/libdiskconfig/diskconfig.c
+++ b/libdiskconfig/diskconfig.c
@@ -45,7 +45,7 @@
     tmp[sizeof(tmp)-1] = '\0';
     len_str = strlen(tmp);
     if (!len_str) {
-        LOGE("Invalid disk length specified.");
+        ALOGE("Invalid disk length specified.");
         return 1;
     }
 
@@ -64,13 +64,13 @@
 
     *plen = strtoull(tmp, NULL, 0);
     if (!*plen) {
-        LOGE("Invalid length specified: %s", str);
+        ALOGE("Invalid length specified: %s", str);
         return 1;
     }
 
     if (*plen == (uint64_t)-1) {
         if (multiple > 1) {
-            LOGE("Size modifier illegal when len is -1");
+            ALOGE("Size modifier illegal when len is -1");
             return 1;
         }
     } else {
@@ -80,7 +80,7 @@
         *plen *= multiple;
 
         if (*plen > 0xffffffffULL) {
-            LOGE("Length specified is too large!: %llu KB", *plen);
+            ALOGE("Length specified is too large!: %llu KB", *plen);
             return 1;
         }
     }
@@ -108,7 +108,7 @@
             pinfo->flags |= PART_ACTIVE_FLAG;
 
         if (!(tmp = config_str(partnode, "type", NULL))) {
-            LOGE("Partition type required: %s", pinfo->name);
+            ALOGE("Partition type required: %s", pinfo->name);
             return 1;
         }
 
@@ -118,7 +118,7 @@
         } else if (!strcmp(tmp, "fat32")) {
             pinfo->type = PC_PART_TYPE_FAT32;
         } else {
-            LOGE("Unsupported partition type found: %s", tmp);
+            ALOGE("Unsupported partition type found: %s", tmp);
             return 1;
         }
 
@@ -146,13 +146,13 @@
     const char *tmp;
 
     if (!(dinfo = malloc(sizeof(struct disk_info)))) {
-        LOGE("Could not malloc disk_info");
+        ALOGE("Could not malloc disk_info");
         return NULL;
     }
     memset(dinfo, 0, sizeof(struct disk_info));
 
     if (!(dinfo->part_lst = malloc(MAX_NUM_PARTS * sizeof(struct part_info)))) {
-        LOGE("Could not malloc part_lst");
+        ALOGE("Could not malloc part_lst");
         goto fail;
     }
     memset(dinfo->part_lst, 0,
@@ -160,33 +160,33 @@
 
     config_load_file(root, fn);
     if (root->first_child == NULL) {
-        LOGE("Could not read config file %s", fn);
+        ALOGE("Could not read config file %s", fn);
         goto fail;
     }
 
     if (!(devroot = config_find(root, "device"))) {
-        LOGE("Could not find device section in config file '%s'", fn);
+        ALOGE("Could not find device section in config file '%s'", fn);
         goto fail;
     }
 
 
     if (!(tmp = config_str(devroot, "path", path_override))) {
-        LOGE("device path is requried");
+        ALOGE("device path is requried");
         goto fail;
     }
     dinfo->device = strdup(tmp);
 
     /* find the partition scheme */
     if (!(tmp = config_str(devroot, "scheme", NULL))) {
-        LOGE("partition scheme is required");
+        ALOGE("partition scheme is required");
         goto fail;
     } else if (!strcmp(tmp, "mbr")) {
         dinfo->scheme = PART_SCHEME_MBR;
     } else if (!strcmp(tmp, "gpt")) {
-        LOGE("'gpt' partition scheme not supported yet.");
+        ALOGE("'gpt' partition scheme not supported yet.");
         goto fail;
     } else {
-        LOGE("Unknown partition scheme specified: %s", tmp);
+        ALOGE("Unknown partition scheme specified: %s", tmp);
         goto fail;
     }
 
@@ -194,30 +194,30 @@
     tmp = config_str(devroot, "sector_size", "512");
     dinfo->sect_size = strtol(tmp, NULL, 0);
     if (!dinfo->sect_size) {
-        LOGE("Invalid sector size: %s", tmp);
+        ALOGE("Invalid sector size: %s", tmp);
         goto fail;
     }
 
     /* first lba where the partitions will start on disk */
     if (!(tmp = config_str(devroot, "start_lba", NULL))) {
-        LOGE("start_lba must be provided");
+        ALOGE("start_lba must be provided");
         goto fail;
     }
 
     if (!(dinfo->skip_lba = strtol(tmp, NULL, 0))) {
-        LOGE("Invalid starting LBA (or zero): %s", tmp);
+        ALOGE("Invalid starting LBA (or zero): %s", tmp);
         goto fail;
     }
 
     /* Number of LBAs on disk */
     if (!(tmp = config_str(devroot, "num_lba", NULL))) {
-        LOGE("num_lba is required");
+        ALOGE("num_lba is required");
         goto fail;
     }
     dinfo->num_lba = strtoul(tmp, NULL, 0);
 
     if (!(partnode = config_find(devroot, "partitions"))) {
-        LOGE("Device must specify partition list");
+        ALOGE("Device must specify partition list");
         goto fail;
     }
 
@@ -244,12 +244,12 @@
     sync();
 
     if (fstat(fd, &stat)) {
-       LOGE("Cannot stat, errno=%d.", errno);
+       ALOGE("Cannot stat, errno=%d.", errno);
        return -1;
     }
 
     if (S_ISBLK(stat.st_mode) && ((rv = ioctl(fd, BLKRRPART, NULL)) < 0)) {
-        LOGE("Could not re-read partition table. REBOOT!. (errno=%d)", errno);
+        ALOGE("Could not re-read partition table. REBOOT!. (errno=%d)", errno);
         return -1;
     }
 
@@ -281,12 +281,12 @@
         return -1;
 
     if ((fd = open(dinfo->device, O_RDWR)) < 0) {
-        LOGE("Cannot open device '%s' (errno=%d)", dinfo->device, errno);
+        ALOGE("Cannot open device '%s' (errno=%d)", dinfo->device, errno);
         return -1;
     }
 
     if (fstat(fd, &stat)) {
-        LOGE("Cannot stat file '%s', errno=%d.", dinfo->device, errno);
+        ALOGE("Cannot stat file '%s', errno=%d.", dinfo->device, errno);
         goto fail;
     }
 
@@ -299,19 +299,19 @@
     if (S_ISBLK(stat.st_mode)) {
         /* get the sector size and make sure we agree */
         if (ioctl(fd, BLKSSZGET, &sect_sz) < 0) {
-            LOGE("Cannot get sector size (errno=%d)", errno);
+            ALOGE("Cannot get sector size (errno=%d)", errno);
             goto fail;
         }
 
         if (!sect_sz || sect_sz != dinfo->sect_size) {
-            LOGE("Device sector size is zero or sector sizes do not match!");
+            ALOGE("Device sector size is zero or sector sizes do not match!");
             goto fail;
         }
 
         /* allow the user override the "disk size" if they provided num_lba */
         if (!dinfo->num_lba) {
             if (ioctl(fd, BLKGETSIZE64, &disk_size) < 0) {
-                LOGE("Could not get block device size (errno=%d)", errno);
+                ALOGE("Could not get block device size (errno=%d)", errno);
                 goto fail;
             }
             /* XXX: we assume that the disk has < 2^32 sectors :-) */
@@ -321,7 +321,7 @@
     } else if (S_ISREG(stat.st_mode)) {
         ALOGI("Requesting operation on a regular file, not block device.");
         if (!dinfo->sect_size) {
-            LOGE("Sector size for regular file images cannot be zero");
+            ALOGE("Sector size for regular file images cannot be zero");
             goto fail;
         }
         if (dinfo->num_lba)
@@ -331,7 +331,7 @@
             disk_size = (uint64_t)stat.st_size;
         }
     } else {
-        LOGE("Device does not refer to a regular file or a block device!");
+        ALOGE("Device does not refer to a regular file or a block device!");
         goto fail;
     }
 
@@ -350,12 +350,12 @@
         if (part->len_kb != (uint32_t)-1) {
             total_size += part->len_kb * 1024;
         } else if (part->len_kb == 0) {
-            LOGE("Zero-size partition '%s' is invalid.", part->name);
+            ALOGE("Zero-size partition '%s' is invalid.", part->name);
             goto fail;
         } else {
             /* the partition requests the rest of the disk. */
             if (cnt + 1 != dinfo->num_parts) {
-                LOGE("Only the last partition in the list can request to fill "
+                ALOGE("Only the last partition in the list can request to fill "
                      "the rest of disk.");
                 goto fail;
             }
@@ -363,7 +363,7 @@
 
         if ((part->type != PC_PART_TYPE_LINUX) &&
             (part->type != PC_PART_TYPE_FAT32)) {
-            LOGE("Unknown partition type (0x%x) encountered for partition "
+            ALOGE("Unknown partition type (0x%x) encountered for partition "
                  "'%s'\n", part->type, part->name);
             goto fail;
         }
@@ -371,7 +371,7 @@
 
     /* only matters for disks, not files */
     if (S_ISBLK(stat.st_mode) && total_size > disk_size) {
-        LOGE("Total requested size of partitions (%llu) is greater than disk "
+        ALOGE("Total requested size of partitions (%llu) is greater than disk "
              "size (%llu).", total_size, disk_size);
         goto fail;
     }
@@ -399,7 +399,7 @@
         case PART_SCHEME_GPT:
             /* not supported yet */
         default:
-            LOGE("Uknown partition scheme.");
+            ALOGE("Uknown partition scheme.");
             break;
     }
 
@@ -438,7 +438,7 @@
     int rv;
 
     if (validate_and_config(dinfo, &fd, &wr_lst) != 0) {
-        LOGE("Configuration is invalid.");
+        ALOGE("Configuration is invalid.");
         goto fail;
     }
 
@@ -523,10 +523,10 @@
         case PART_SCHEME_MBR:
             return find_mbr_part(dinfo, name);
         case PART_SCHEME_GPT:
-            LOGE("GPT is presently not supported");
+            ALOGE("GPT is presently not supported");
             break;
         default:
-            LOGE("Unknown partition table scheme");
+            ALOGE("Unknown partition table scheme");
             break;
     }
 
diff --git a/libdiskconfig/diskutils.c b/libdiskconfig/diskutils.c
index be35763..e325735 100644
--- a/libdiskconfig/diskutils.c
+++ b/libdiskconfig/diskutils.c
@@ -42,18 +42,18 @@
 
     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);
+        ALOGE("Could not open %s for reading (errno=%d).", src, errno);
         goto fail;
     }
 
     if (!test) {
         if ((dst_fd = open(dst, O_RDWR)) < 0) {
-            LOGE("Could not open '%s' for read/write (errno=%d).", dst, errno);
+            ALOGE("Could not open '%s' for read/write (errno=%d).", dst, errno);
             goto fail;
         }
 
         if (lseek64(dst_fd, offset, SEEK_SET) != offset) {
-            LOGE("Could not seek to offset %lld in %s.", offset, dst);
+            ALOGE("Could not seek to offset %lld in %s.", offset, dst);
             goto fail;
         }
     }
@@ -63,7 +63,7 @@
             /* XXX: Should we not even bother with EINTR? */
             if (errno == EINTR)
                 continue;
-            LOGE("Error (%d) while reading from '%s'", errno, src);
+            ALOGE("Error (%d) while reading from '%s'", errno, src);
             goto fail;
         }
 
@@ -84,7 +84,7 @@
                 /* XXX: Should we not even bother with EINTR? */
                 if (errno == EINTR)
                     continue;
-                LOGE("Error (%d) while writing to '%s'", errno, dst);
+                ALOGE("Error (%d) while writing to '%s'", errno, dst);
                 goto fail;
             }
             if (!tmp)
@@ -94,7 +94,7 @@
     }
 
     if (!done) {
-        LOGE("Exited read/write loop without setting flag! WTF?!");
+        ALOGE("Exited read/write loop without setting flag! WTF?!");
         goto fail;
     }
 
diff --git a/libdiskconfig/dump_diskconfig.c b/libdiskconfig/dump_diskconfig.c
index fff19f5..75256f6 100644
--- a/libdiskconfig/dump_diskconfig.c
+++ b/libdiskconfig/dump_diskconfig.c
@@ -28,7 +28,7 @@
     struct disk_info *dinfo;
 
     if (argc < 2) {
-        LOGE("usage: %s <conf file>", argv[0]);
+        ALOGE("usage: %s <conf file>", argv[0]);
         return 1;
     }
 
diff --git a/libdiskconfig/write_lst.c b/libdiskconfig/write_lst.c
index d99a807..826ef7a 100644
--- a/libdiskconfig/write_lst.c
+++ b/libdiskconfig/write_lst.c
@@ -32,7 +32,7 @@
     struct write_list *item;
 
     if (!(item = malloc(sizeof(struct write_list) + data_len))) {
-        LOGE("Unable to allocate memory.");
+        ALOGE("Unable to allocate memory.");
         return NULL;
     }
 
@@ -71,13 +71,13 @@
 {
     for(; lst; lst = lst->next) {
         if (lseek64(fd, lst->offset, SEEK_SET) != (loff_t)lst->offset) {
-            LOGE("Cannot seek to the specified position (%lld).", lst->offset);
+            ALOGE("Cannot seek to the specified position (%lld).", lst->offset);
             goto fail;
         }
 
         if (!test) {
             if (write(fd, lst->data, lst->len) != (int)lst->len) {
-                LOGE("Failed writing %u bytes at position %lld.", lst->len,
+                ALOGE("Failed writing %u bytes at position %lld.", lst->len,
                      lst->offset);
                 goto fail;
             }
diff --git a/libnetutils/ifc_utils.c b/libnetutils/ifc_utils.c
index 8564ed9..186b98c 100644
--- a/libnetutils/ifc_utils.c
+++ b/libnetutils/ifc_utils.c
@@ -382,7 +382,7 @@
 
         ret = ifc_del_address(ifname, addrstr, prefixlen);
         if (ret) {
-            LOGE("Deleting address %s/%d on %s: %s", addrstr, prefixlen, ifname,
+            ALOGE("Deleting address %s/%d on %s: %s", addrstr, prefixlen, ifname,
                  strerror(-ret));
             lasterror = ret;
         }
diff --git a/libpixelflinger/codeflinger/CodeCache.cpp b/libpixelflinger/codeflinger/CodeCache.cpp
index 125c3ce..a713feb 100644
--- a/libpixelflinger/codeflinger/CodeCache.cpp
+++ b/libpixelflinger/codeflinger/CodeCache.cpp
@@ -159,7 +159,7 @@
         const long base = long(assembly->base());
         const long curr = base + long(assembly->size());
         err = cacheflush(base, curr, 0);
-        LOGE_IF(err, "__ARM_NR_cacheflush error %s\n",
+        ALOGE_IF(err, "__ARM_NR_cacheflush error %s\n",
                 strerror(errno));
 #endif
     }
diff --git a/libpixelflinger/codeflinger/GGLAssembler.cpp b/libpixelflinger/codeflinger/GGLAssembler.cpp
index 1cd189c..f1d81b2 100644
--- a/libpixelflinger/codeflinger/GGLAssembler.cpp
+++ b/libpixelflinger/codeflinger/GGLAssembler.cpp
@@ -82,7 +82,7 @@
             needs.p, needs.n, needs.t[0], needs.t[1], per_fragment_ops);
 
     if (err) {
-        LOGE("Error while generating ""%s""\n", name);
+        ALOGE("Error while generating ""%s""\n", name);
         disassemble(name);
         return -1;
     }
@@ -1095,7 +1095,7 @@
     }
     // this is not an error anymore because, we'll try again with
     // a lower optimization level.
-    //LOGE_IF(i >= nbreg, "pixelflinger ran out of registers\n");
+    //ALOGE_IF(i >= nbreg, "pixelflinger ran out of registers\n");
     if (i >= nbreg) {
         mStatus |= OUT_OF_REGISTERS;
         // we return SP so we can more easily debug things
diff --git a/libpixelflinger/codeflinger/blending.cpp b/libpixelflinger/codeflinger/blending.cpp
index 083042c..c90eaa0 100644
--- a/libpixelflinger/codeflinger/blending.cpp
+++ b/libpixelflinger/codeflinger/blending.cpp
@@ -536,7 +536,7 @@
         }
     }
 
-    LOGE_IF(ms>=32, "mul_factor overflow vs=%d, fs=%d", vs, fs);
+    ALOGE_IF(ms>=32, "mul_factor overflow vs=%d, fs=%d", vs, fs);
 
     int vreg = v.reg;
     int freg = f.reg;
@@ -574,7 +574,7 @@
     int as = a.h;
     int ms = vs+fs;
 
-    LOGE_IF(ms>=32, "mul_factor_add overflow vs=%d, fs=%d, as=%d", vs, fs, as);
+    ALOGE_IF(ms>=32, "mul_factor_add overflow vs=%d, fs=%d, as=%d", vs, fs, as);
 
     integer_t add(a.reg, a.h, a.flags);
 
diff --git a/libpixelflinger/codeflinger/load_store.cpp b/libpixelflinger/codeflinger/load_store.cpp
index ed20a00..62aa05c 100644
--- a/libpixelflinger/codeflinger/load_store.cpp
+++ b/libpixelflinger/codeflinger/load_store.cpp
@@ -257,7 +257,7 @@
     int dbits = dh - dl;
     int dithering = 0;
     
-    LOGE_IF(sbits<dbits, "sbits (%d) < dbits (%d) in downshift", sbits, dbits);
+    ALOGE_IF(sbits<dbits, "sbits (%d) < dbits (%d) in downshift", sbits, dbits);
 
     if (sbits>dbits) {
         // see if we need to dither
diff --git a/libpixelflinger/codeflinger/texturing.cpp b/libpixelflinger/codeflinger/texturing.cpp
index 7f6f8da..8464fbd 100644
--- a/libpixelflinger/codeflinger/texturing.cpp
+++ b/libpixelflinger/codeflinger/texturing.cpp
@@ -778,7 +778,7 @@
             break;
         default:
             // unsupported format, do something sensical...
-            LOGE("Unsupported 16-bits texture format (%d)", tmu.format_idx);
+            ALOGE("Unsupported 16-bits texture format (%d)", tmu.format_idx);
             LDRH(AL, texel.reg, txPtr.reg);
             return;
     }
diff --git a/libpixelflinger/scanline.cpp b/libpixelflinger/scanline.cpp
index 6c55379..93440f5 100644
--- a/libpixelflinger/scanline.cpp
+++ b/libpixelflinger/scanline.cpp
@@ -381,7 +381,7 @@
             err = gCodeCache.cache(a->key(), a);
         }
         if (ggl_unlikely(err)) {
-            LOGE("error generating or caching assembly. Reverting to NOP.");
+            ALOGE("error generating or caching assembly. Reverting to NOP.");
             c->scanline = scanline_noop;
             c->init_y = init_y_noop;
             c->step_y = step_y__nop;
@@ -1761,7 +1761,7 @@
     // woooops, shoud never happen,
     // fail gracefully (don't display anything)
     init_y_noop(c, y0);
-    LOGE("color-buffer has an invalid format!");
+    ALOGE("color-buffer has an invalid format!");
 }
 
 // ----------------------------------------------------------------------------
diff --git a/nexus/CommandListener.cpp b/nexus/CommandListener.cpp
index 5c50acc..7c934a7 100644
--- a/nexus/CommandListener.cpp
+++ b/nexus/CommandListener.cpp
@@ -218,7 +218,7 @@
 
         char *buf;
         if (asprintf(&buf, "%s %s", (*it), p_v) < 0) {
-            LOGE("Failed to allocate memory");
+            ALOGE("Failed to allocate memory");
             free((*it));
             continue;
         }
diff --git a/nexus/Controller.cpp b/nexus/Controller.cpp
index 4f4c473..dae8783 100644
--- a/nexus/Controller.cpp
+++ b/nexus/Controller.cpp
@@ -96,7 +96,7 @@
     FILE *fp = fopen("/proc/modules", "r");
 
     if (!fp) {
-        LOGE("Unable to open /proc/modules (%s)", strerror(errno));
+        ALOGE("Unable to open /proc/modules (%s)", strerror(errno));
         return false;
     }
 
diff --git a/nexus/DhcpClient.cpp b/nexus/DhcpClient.cpp
index 02adf91..81fdf47 100644
--- a/nexus/DhcpClient.cpp
+++ b/nexus/DhcpClient.cpp
@@ -72,7 +72,7 @@
 
     sockaddr_in addr;
     if ((mListenerSocket = socket(AF_INET, SOCK_DGRAM, IPPROTO_UDP)) < 0) {
-        LOGE("Failed to create DHCP listener socket");
+        ALOGE("Failed to create DHCP listener socket");
         pthread_mutex_unlock(&mLock);
         return -1;
     }
@@ -82,7 +82,7 @@
     addr.sin_port = htons(DhcpClient::STATUS_MONITOR_PORT);
 
     if (bind(mListenerSocket, (struct sockaddr *) &addr, sizeof(addr))) {
-        LOGE("Failed to bind DHCP listener socket");
+        ALOGE("Failed to bind DHCP listener socket");
         close(mListenerSocket);
         mListenerSocket = -1;
         pthread_mutex_unlock(&mLock);
@@ -90,14 +90,14 @@
     }
 
     if (mServiceManager->start(svc)) {
-        LOGE("Failed to start dhcp service");
+        ALOGE("Failed to start dhcp service");
         pthread_mutex_unlock(&mLock);
         return -1;
     }
 
     mListener = new DhcpListener(mController, mListenerSocket, mHandlers);
     if (mListener->startListener()) {
-        LOGE("Failed to start listener");
+        ALOGE("Failed to start listener");
 #if 0
         mServiceManager->stop("dhcpcd");
         return -1;
diff --git a/nexus/NetworkManager.cpp b/nexus/NetworkManager.cpp
index 78ccbd8..d4285bf 100644
--- a/nexus/NetworkManager.cpp
+++ b/nexus/NetworkManager.cpp
@@ -110,7 +110,7 @@
     ALOGD("Controller %s interface %s connected", c->getName(), c->getBoundInterface());
 
     if (mDhcp->start(c)) {
-        LOGE("Failed to start DHCP (%s)", strerror(errno));
+        ALOGE("Failed to start DHCP (%s)", strerror(errno));
         return;
     }
 }
diff --git a/nexus/OpenVpnController.cpp b/nexus/OpenVpnController.cpp
index f1ea510..6b6d892 100644
--- a/nexus/OpenVpnController.cpp
+++ b/nexus/OpenVpnController.cpp
@@ -53,7 +53,7 @@
     char tmp[64];
 
     if (!mPropMngr->get("vpn.gateway", tmp, sizeof(tmp))) {
-        LOGE("Error reading property 'vpn.gateway' (%s)", strerror(errno));
+        ALOGE("Error reading property 'vpn.gateway' (%s)", strerror(errno));
         return -1;
     }
     snprintf(svc, sizeof(svc), "openvpn:--remote %s 1194", tmp);
diff --git a/nexus/Property.cpp b/nexus/Property.cpp
index 821d22f..6cfa955 100644
--- a/nexus/Property.cpp
+++ b/nexus/Property.cpp
@@ -38,22 +38,22 @@
                 Property(name, ro, Property::Type_STRING, elements) {
 }
 int StringProperty::set(int idx, int value) {
-    LOGE("Integer 'set' called on string property!");
+    ALOGE("Integer 'set' called on string property!");
     errno = EINVAL;
     return -1;
 }
 int StringProperty::set(int idx, struct in_addr *value) {
-    LOGE("IpAddr 'set' called on string property!");
+    ALOGE("IpAddr 'set' called on string property!");
     errno = EINVAL;
     return -1;
 }
 int StringProperty::get(int idx, int *buffer) {
-    LOGE("Integer 'get' called on string property!");
+    ALOGE("Integer 'get' called on string property!");
     errno = EINVAL;
     return -1;
 }
 int StringProperty::get(int idx, struct in_addr *buffer) {
-    LOGE("IpAddr 'get' called on string property!");
+    ALOGE("IpAddr 'get' called on string property!");
     errno = EINVAL;
     return -1;
 }
@@ -90,22 +90,22 @@
 }
 
 int IntegerProperty::set(int idx, const char *value) {
-    LOGE("String 'set' called on integer property!");
+    ALOGE("String 'set' called on integer property!");
     errno = EINVAL;
     return -1;
 }
 int IntegerProperty::set(int idx, struct in_addr *value) {
-    LOGE("IpAddr 'set' called on integer property!");
+    ALOGE("IpAddr 'set' called on integer property!");
     errno = EINVAL;
     return -1;
 }
 int IntegerProperty::get(int idx, char *buffer, size_t max) {
-    LOGE("String 'get' called on integer property!");
+    ALOGE("String 'get' called on integer property!");
     errno = EINVAL;
     return -1;
 }
 int IntegerProperty::get(int idx, struct in_addr *buffer) {
-    LOGE("IpAddr 'get' called on integer property!");
+    ALOGE("IpAddr 'get' called on integer property!");
     errno = EINVAL;
     return -1;
 }
@@ -141,22 +141,22 @@
 }
 
 int IPV4AddressProperty::set(int idx, const char *value) {
-    LOGE("String 'set' called on ipv4 property!");
+    ALOGE("String 'set' called on ipv4 property!");
     errno = EINVAL;
     return -1;
 }
 int IPV4AddressProperty::set(int idx, int value) {
-    LOGE("Integer 'set' called on ipv4 property!");
+    ALOGE("Integer 'set' called on ipv4 property!");
     errno = EINVAL;
     return -1;
 }
 int IPV4AddressProperty::get(int idx, char *buffer, size_t max) {
-    LOGE("String 'get' called on ipv4 property!");
+    ALOGE("String 'get' called on ipv4 property!");
     errno = EINVAL;
     return -1;
 }
 int IPV4AddressProperty::get(int idx, int *buffer) {
-    LOGE("Integer 'get' called on ipv4 property!");
+    ALOGE("Integer 'get' called on ipv4 property!");
     errno = EINVAL;
     return -1;
 }
diff --git a/nexus/PropertyManager.cpp b/nexus/PropertyManager.cpp
index 1caaba6..41cdb41 100644
--- a/nexus/PropertyManager.cpp
+++ b/nexus/PropertyManager.cpp
@@ -77,7 +77,7 @@
     if (lookupProperty_UNLOCKED(ns, p->getName())) {
         errno = EADDRINUSE;
         pthread_mutex_unlock(&mLock);
-        LOGE("Failed to register property %s.%s (%s)",
+        ALOGE("Failed to register property %s.%s (%s)",
             ns_name, p->getName(), strerror(errno));
         return -1;
     }
@@ -94,7 +94,7 @@
     pthread_mutex_lock(&mLock);
     if (!(ns = lookupNamespace_UNLOCKED(ns_name))) {
         pthread_mutex_unlock(&mLock);
-        LOGE("Namespace '%s' not found", ns_name);
+        ALOGE("Namespace '%s' not found", ns_name);
         return -1;
     }
 
@@ -110,7 +110,7 @@
         }
     }
 
-    LOGE("Property %s.%s not found", ns_name, p->getName());
+    ALOGE("Property %s.%s not found", ns_name, p->getName());
     pthread_mutex_unlock(&mLock);
     errno = ENOENT;
     return -1;
@@ -130,7 +130,7 @@
         errno = 0;
         tmp = strtol(value, (char **) NULL, 10);
         if (errno) {
-            LOGE("Failed to convert '%s' to int", value);
+            ALOGE("Failed to convert '%s' to int", value);
             errno = EINVAL;
             return -1;
         }
@@ -138,13 +138,13 @@
     } else if (p->getType() == Property::Type_IPV4) {
         struct in_addr tmp;
         if (!inet_aton(value, &tmp)) {
-            LOGE("Failed to convert '%s' to ipv4", value);
+            ALOGE("Failed to convert '%s' to ipv4", value);
             errno = EINVAL;
             return -1;
         }
         return p->set(idx, &tmp);
     } else {
-        LOGE("Property '%s' has an unknown type (%d)", p->getName(),
+        ALOGE("Property '%s' has an unknown type (%d)", p->getName(),
              p->getType());
         errno = EINVAL;
         return -1;
@@ -179,7 +179,7 @@
         }
         strncpy(buffer, inet_ntoa(tmp), max);
     } else {
-        LOGE("Property '%s' has an unknown type (%d)", p->getName(),
+        ALOGE("Property '%s' has an unknown type (%d)", p->getName(),
              p->getType());
         errno = EINVAL;
         return -1;
@@ -215,7 +215,7 @@
         }
     }
 
-    LOGE("Property %s not found", name);
+    ALOGE("Property %s not found", name);
     pthread_mutex_unlock(&mLock);
     errno = ENOENT;
     return -1;
@@ -246,7 +246,7 @@
         }
     }
 
-    LOGE("Property %s not found", name);
+    ALOGE("Property %s not found", name);
     pthread_mutex_unlock(&mLock);
     errno = ENOENT;
     return NULL;
diff --git a/nexus/Supplicant.cpp b/nexus/Supplicant.cpp
index f5298f7..b604698 100644
--- a/nexus/Supplicant.cpp
+++ b/nexus/Supplicant.cpp
@@ -68,18 +68,18 @@
     }
 
     if (mServiceManager->start(SUPPLICANT_SERVICE_NAME)) {
-        LOGE("Error starting supplicant (%s)", strerror(errno));
+        ALOGE("Error starting supplicant (%s)", strerror(errno));
         return -1;
     }
 
     wpa_ctrl_cleanup();
     if (connectToSupplicant()) {
-        LOGE("Error connecting to supplicant (%s)\n", strerror(errno));
+        ALOGE("Error connecting to supplicant (%s)\n", strerror(errno));
         return -1;
     }
     
     if (retrieveInterfaceName()) {
-        LOGE("Error retrieving interface name (%s)\n", strerror(errno));
+        ALOGE("Error retrieving interface name (%s)\n", strerror(errno));
         return -1;
     }
 
@@ -247,7 +247,7 @@
 
     mCtrl = wpa_ctrl_open("tiwlan0"); // XXX:
     if (mCtrl == NULL) {
-        LOGE("Unable to open connection to supplicant on \"%s\": %s",
+        ALOGE("Unable to open connection to supplicant on \"%s\": %s",
              "tiwlan0", strerror(errno));
         return -1;
     }
@@ -267,7 +267,7 @@
     mListener = new SupplicantListener(mHandlers, mMonitor);
 
     if (mListener->startListener()) {
-        LOGE("Error - unable to start supplicant listener");
+        ALOGE("Error - unable to start supplicant listener");
         stop();
         return -1;
     }
@@ -311,7 +311,7 @@
     char *s;
     for (int i = 0; i < 3; i++) {
         if (!(s = strsep(&next, " "))) {
-            LOGE("Error parsing RSSI");
+            ALOGE("Error parsing RSSI");
             errno = EIO;
             return -1;
         }
@@ -333,13 +333,13 @@
     char *s;
 
     if (!(s = strsep(&next, " "))) {
-        LOGE("Error parsing LINKSPEED");
+        ALOGE("Error parsing LINKSPEED");
         errno = EIO;
         return -1;
     }
 
     if (!(s = strsep(&next, " "))) {
-        LOGE("Error parsing LINKSPEED");
+        ALOGE("Error parsing LINKSPEED");
         errno = EIO;
         return -1;
     }
@@ -452,26 +452,26 @@
     if (access(SUPP_CONFIG_FILE, R_OK|W_OK) == 0) {
         return 0;
     } else if (errno != ENOENT) {
-        LOGE("Cannot access \"%s\": %s", SUPP_CONFIG_FILE, strerror(errno));
+        ALOGE("Cannot access \"%s\": %s", SUPP_CONFIG_FILE, strerror(errno));
         return -1;
     }
 
     srcfd = open(SUPP_CONFIG_TEMPLATE, O_RDONLY);
     if (srcfd < 0) {
-        LOGE("Cannot open \"%s\": %s", SUPP_CONFIG_TEMPLATE, strerror(errno));
+        ALOGE("Cannot open \"%s\": %s", SUPP_CONFIG_TEMPLATE, strerror(errno));
         return -1;
     }
 
     destfd = open(SUPP_CONFIG_FILE, O_CREAT|O_WRONLY, 0660);
     if (destfd < 0) {
         close(srcfd);
-        LOGE("Cannot create \"%s\": %s", SUPP_CONFIG_FILE, strerror(errno));
+        ALOGE("Cannot create \"%s\": %s", SUPP_CONFIG_FILE, strerror(errno));
         return -1;
     }
 
     while ((nread = read(srcfd, buf, sizeof(buf))) != 0) {
         if (nread < 0) {
-            LOGE("Error reading \"%s\": %s", SUPP_CONFIG_TEMPLATE, strerror(errno));
+            ALOGE("Error reading \"%s\": %s", SUPP_CONFIG_TEMPLATE, strerror(errno));
             close(srcfd);
             close(destfd);
             unlink(SUPP_CONFIG_FILE);
@@ -484,7 +484,7 @@
     close(srcfd);
 
     if (chown(SUPP_CONFIG_FILE, AID_SYSTEM, AID_WIFI) < 0) {
-        LOGE("Error changing group ownership of %s to %d: %s",
+        ALOGE("Error changing group ownership of %s to %d: %s",
              SUPP_CONFIG_FILE, AID_WIFI, strerror(errno));
         unlink(SUPP_CONFIG_FILE);
         return -1;
@@ -507,7 +507,7 @@
 
     len = sizeof(reply) -1;
     if (sendCommand("SAVE_CONFIG", reply, &len)) {
-        LOGE("Error saving config after %s = %s", var, val);
+        ALOGE("Error saving config after %s = %s", var, val);
         return -1;
     }
     return 0;
diff --git a/nexus/SupplicantAssociatingEvent.cpp b/nexus/SupplicantAssociatingEvent.cpp
index c6e9fe3..8fe502e 100644
--- a/nexus/SupplicantAssociatingEvent.cpp
+++ b/nexus/SupplicantAssociatingEvent.cpp
@@ -46,7 +46,7 @@
         //                           p
         char *q = index(p, '\'');
         if (!q) {
-            LOGE("Unable to decode SSID (p = {%s})\n", p);
+            ALOGE("Unable to decode SSID (p = {%s})\n", p);
             return;
         }
         mSsid = (char *) malloc((q - p) +1);
@@ -59,7 +59,7 @@
         //                                         ^
         //                                         p
         if (!(q = index(p, ' '))) {
-            LOGE("Unable to decode frequency\n");
+            ALOGE("Unable to decode frequency\n");
             return;
         }
         *q = '\0';
@@ -73,7 +73,7 @@
 
         char *q = index(p, '\'');
         if (!q) {
-            LOGE("Unable to decode SSID (p = {%s})\n", p);
+            ALOGE("Unable to decode SSID (p = {%s})\n", p);
             return;
         }
         mSsid = (char *) malloc((q - p) +1);
diff --git a/nexus/SupplicantConnectedEvent.cpp b/nexus/SupplicantConnectedEvent.cpp
index e58bab2..107c766 100644
--- a/nexus/SupplicantConnectedEvent.cpp
+++ b/nexus/SupplicantConnectedEvent.cpp
@@ -42,9 +42,9 @@
             else
                 mReassociated = true;
         } else
-            LOGE("Unable to decode re-assocation");
+            ALOGE("Unable to decode re-assocation");
     } else
-        LOGE("Unable to decode event");
+        ALOGE("Unable to decode event");
 }
 
 SupplicantConnectedEvent::SupplicantConnectedEvent(const char *bssid, 
diff --git a/nexus/SupplicantListener.cpp b/nexus/SupplicantListener.cpp
index b59a7a8..421d84d 100644
--- a/nexus/SupplicantListener.cpp
+++ b/nexus/SupplicantListener.cpp
@@ -48,7 +48,7 @@
     size_t nread = buflen - 1;
 
     if ((rc = wpa_ctrl_recv(mMonitor, buf, &nread))) {
-        LOGE("wpa_ctrl_recv failed (%s)", strerror(errno));
+        ALOGE("wpa_ctrl_recv failed (%s)", strerror(errno));
         return false;
     }
 
diff --git a/nexus/SupplicantStatus.cpp b/nexus/SupplicantStatus.cpp
index 7868264..8f28abe 100644
--- a/nexus/SupplicantStatus.cpp
+++ b/nexus/SupplicantStatus.cpp
@@ -81,7 +81,7 @@
             else if (!strcmp(value, "IDLE"))
                 state = SupplicantState::IDLE;
             else 
-                LOGE("Unknown supplicant state '%s'", value);
+                ALOGE("Unknown supplicant state '%s'", value);
         } else
             ALOGD("Ignoring unsupported status token '%s'", token);
     }
diff --git a/nexus/TiwlanEventListener.cpp b/nexus/TiwlanEventListener.cpp
index 4851e28..fde3a44 100644
--- a/nexus/TiwlanEventListener.cpp
+++ b/nexus/TiwlanEventListener.cpp
@@ -33,12 +33,12 @@
     struct ipc_ev_data *data;
 
     if (!(data = (struct ipc_ev_data *) malloc(sizeof(struct ipc_ev_data)))) {
-        LOGE("Failed to allocate packet (out of memory)");
+        ALOGE("Failed to allocate packet (out of memory)");
         return true;
     }
 
     if (recv(cli->getSocket(), data, sizeof(struct ipc_ev_data), 0) < 0) {
-       LOGE("recv failed (%s)", strerror(errno));
+       ALOGE("recv failed (%s)", strerror(errno));
        goto out;
     }
 
diff --git a/nexus/TiwlanWifiController.cpp b/nexus/TiwlanWifiController.cpp
index 311bf16..76b6a2e 100644
--- a/nexus/TiwlanWifiController.cpp
+++ b/nexus/TiwlanWifiController.cpp
@@ -84,14 +84,14 @@
 
                 return 0;
             } else if (!strcmp(DRIVER_PROP_NAME, "failed")) {
-                LOGE("Firmware load failed");
+                ALOGE("Firmware load failed");
                 return -1;
             }
         }
         usleep(200000);
     }
     property_set(DRIVER_PROP_NAME, "timeout");
-    LOGE("Firmware load timed out");
+    ALOGE("Firmware load timed out");
     return -1;
 }
 
@@ -99,13 +99,13 @@
     struct sockaddr_in addr;
 
     if (mListenerSock != -1) {
-        LOGE("Listener already started!");
+        ALOGE("Listener already started!");
         errno = EBUSY;
         return -1;
     }
 
     if ((mListenerSock = socket(PF_INET, SOCK_DGRAM, IPPROTO_UDP)) < 0) {
-        LOGE("socket failed (%s)", strerror(errno));
+        ALOGE("socket failed (%s)", strerror(errno));
         return -1;
     }
 
@@ -117,14 +117,14 @@
     if (bind(mListenerSock,
              (struct sockaddr *) &addr,
              sizeof(addr)) < 0) {
-        LOGE("bind failed (%s)", strerror(errno));
+        ALOGE("bind failed (%s)", strerror(errno));
         goto out_err;
     }
 
     mEventListener = new TiwlanEventListener(mListenerSock);
 
     if (mEventListener->startListener()) {
-        LOGE("Error starting driver listener (%s)", strerror(errno));
+        ALOGE("Error starting driver listener (%s)", strerror(errno));
         goto out_err;
     }
     return 0;
diff --git a/nexus/WifiController.cpp b/nexus/WifiController.cpp
index e11f668..cedd013 100644
--- a/nexus/WifiController.cpp
+++ b/nexus/WifiController.cpp
@@ -111,7 +111,7 @@
         ALOGI("Powering up");
         sendStatusBroadcast("Powering up WiFi hardware");
         if (powerUp()) {
-            LOGE("Powerup failed (%s)", strerror(errno));
+            ALOGE("Powerup failed (%s)", strerror(errno));
             return -1;
         }
     }
@@ -120,7 +120,7 @@
         ALOGI("Loading driver");
         sendStatusBroadcast("Loading WiFi driver");
         if (loadKernelModule(mModulePath, mModuleArgs)) {
-            LOGE("Kernel module load failed (%s)", strerror(errno));
+            ALOGE("Kernel module load failed (%s)", strerror(errno));
             goto out_powerdown;
         }
     }
@@ -129,7 +129,7 @@
         ALOGI("Loading firmware");
         sendStatusBroadcast("Loading WiFI firmware");
         if (loadFirmware()) {
-            LOGE("Firmware load failed (%s)", strerror(errno));
+            ALOGE("Firmware load failed (%s)", strerror(errno));
             goto out_powerdown;
         }
     }
@@ -138,13 +138,13 @@
         ALOGI("Starting WPA Supplicant");
         sendStatusBroadcast("Starting WPA Supplicant");
         if (mSupplicant->start()) {
-            LOGE("Supplicant start failed (%s)", strerror(errno));
+            ALOGE("Supplicant start failed (%s)", strerror(errno));
             goto out_unloadmodule;
         }
     }
 
     if (Controller::bindInterface(mSupplicant->getInterfaceName())) {
-        LOGE("Error binding interface (%s)", strerror(errno));
+        ALOGE("Error binding interface (%s)", strerror(errno));
         goto out_unloadmodule;
     }
 
@@ -173,13 +173,13 @@
 out_unloadmodule:
     if (mModuleName[0] != '\0' && !isKernelModuleLoaded(mModuleName)) {
         if (unloadKernelModule(mModuleName)) {
-            LOGE("Unable to unload module after failure!");
+            ALOGE("Unable to unload module after failure!");
         }
     }
 
 out_powerdown:
     if (powerDown()) {
-        LOGE("Unable to powerdown after failure!");
+        ALOGE("Unable to powerdown after failure!");
     }
     return -1;
 }
@@ -218,7 +218,7 @@
 
         ALOGD("Stopping Supplicant driver");
         if (mSupplicant->stopDriver()) {
-            LOGE("Error stopping driver (%s)", strerror(errno));
+            ALOGE("Error stopping driver (%s)", strerror(errno));
             pthread_mutex_unlock(&mLock);
             return -1;
         }
@@ -226,7 +226,7 @@
         ALOGD("Resuming");
 
         if (mSupplicant->startDriver()) {
-            LOGE("Error resuming driver (%s)", strerror(errno));
+            ALOGE("Error resuming driver (%s)", strerror(errno));
             pthread_mutex_unlock(&mLock);
             return -1;
         }
@@ -269,7 +269,7 @@
     if (mSupplicant->isStarted()) {
         sendStatusBroadcast("Stopping WPA Supplicant");
         if (mSupplicant->stop()) {
-            LOGE("Supplicant stop failed (%s)", strerror(errno));
+            ALOGE("Supplicant stop failed (%s)", strerror(errno));
             return -1;
         }
     } else
@@ -278,7 +278,7 @@
     if (mModuleName[0] != '\0' && isKernelModuleLoaded(mModuleName)) {
         sendStatusBroadcast("Unloading WiFi driver");
         if (unloadKernelModule(mModuleName)) {
-            LOGE("Unable to unload module (%s)", strerror(errno));
+            ALOGE("Unable to unload module (%s)", strerror(errno));
             return -1;
         }
     }
@@ -286,7 +286,7 @@
     if (isPoweredUp()) {
         sendStatusBroadcast("Powering down WiFi hardware");
         if (powerDown()) {
-            LOGE("Powerdown failed (%s)", strerror(errno));
+            ALOGE("Powerdown failed (%s)", strerror(errno));
             return -1;
         }
     }
@@ -470,7 +470,7 @@
     char *reply;
 
     if (!(reply = (char *) malloc(4096))) {
-        LOGE("Out of memory");
+        ALOGE("Out of memory");
         return;
     }
 
@@ -609,7 +609,7 @@
     pthread_mutex_lock(&mLock);
     int rssi;
     if (mSupplicant->getRssi(&rssi)) {
-        LOGE("Failed to get rssi (%s)", strerror(errno));
+        ALOGE("Failed to get rssi (%s)", strerror(errno));
         pthread_mutex_unlock(&mLock);
         return;
     }
diff --git a/nexus/WifiNetwork.cpp b/nexus/WifiNetwork.cpp
index 346c7c2..0197b64 100644
--- a/nexus/WifiNetwork.cpp
+++ b/nexus/WifiNetwork.cpp
@@ -43,13 +43,13 @@
     char *flags;
 
     if (!(id = strsep(&next, "\t")))
-        LOGE("Failed to extract network id");
+        ALOGE("Failed to extract network id");
     if (!(ssid = strsep(&next, "\t")))
-        LOGE("Failed to extract ssid");
+        ALOGE("Failed to extract ssid");
     if (!(bssid = strsep(&next, "\t")))
-        LOGE("Failed to extract bssid");
+        ALOGE("Failed to extract bssid");
     if (!(flags = strsep(&next, "\t")))
-        LOGE("Failed to extract flags");
+        ALOGE("Failed to extract flags");
 
    // ALOGD("id '%s', ssid '%s', bssid '%s', flags '%s'", id, ssid, bssid,
    //      flags ? flags :"null");
@@ -215,7 +215,7 @@
     len = sizeof(buffer);
     if (mSuppl->getNetworkVar(mNetid, "key_mgmt", buffer, len)) {
         if (WifiNetwork::parseKeyManagementMask(buffer, &mask)) {
-            LOGE("Error parsing key_mgmt (%s)", strerror(errno));
+            ALOGE("Error parsing key_mgmt (%s)", strerror(errno));
         } else {
            mKeyManagement = mask;
         }
@@ -224,7 +224,7 @@
     len = sizeof(buffer);
     if (mSuppl->getNetworkVar(mNetid, "proto", buffer, len)) {
         if (WifiNetwork::parseProtocolsMask(buffer, &mask)) {
-            LOGE("Error parsing proto (%s)", strerror(errno));
+            ALOGE("Error parsing proto (%s)", strerror(errno));
         } else {
            mProtocols = mask;
         }
@@ -233,7 +233,7 @@
     len = sizeof(buffer);
     if (mSuppl->getNetworkVar(mNetid, "auth_alg", buffer, len)) {
         if (WifiNetwork::parseAuthAlgorithmsMask(buffer, &mask)) {
-            LOGE("Error parsing auth_alg (%s)", strerror(errno));
+            ALOGE("Error parsing auth_alg (%s)", strerror(errno));
         } else {
            mAuthAlgorithms = mask;
         }
@@ -242,7 +242,7 @@
     len = sizeof(buffer);
     if (mSuppl->getNetworkVar(mNetid, "pairwise", buffer, len)) {
         if (WifiNetwork::parsePairwiseCiphersMask(buffer, &mask)) {
-            LOGE("Error parsing pairwise (%s)", strerror(errno));
+            ALOGE("Error parsing pairwise (%s)", strerror(errno));
         } else {
            mPairwiseCiphers = mask;
         }
@@ -251,7 +251,7 @@
     len = sizeof(buffer);
     if (mSuppl->getNetworkVar(mNetid, "group", buffer, len)) {
         if (WifiNetwork::parseGroupCiphersMask(buffer, &mask)) {
-            LOGE("Error parsing group (%s)", strerror(errno));
+            ALOGE("Error parsing group (%s)", strerror(errno));
         } else {
            mGroupCiphers = mask;
         }
@@ -259,7 +259,7 @@
 
     return 0;
 out_err:
-    LOGE("Refresh failed (%s)",strerror(errno));
+    ALOGE("Refresh failed (%s)",strerror(errno));
     return -1;
 }
 
@@ -453,12 +453,12 @@
 
     if (enabled) {
         if (getPriority() == -1) {
-            LOGE("Cannot enable network when priority is not set");
+            ALOGE("Cannot enable network when priority is not set");
             errno = EAGAIN;
             return -1;
         }
         if (getKeyManagement() == KeyManagementMask::UNKNOWN) {
-            LOGE("Cannot enable network when KeyManagement is not set");
+            ALOGE("Cannot enable network when KeyManagement is not set");
             errno = EAGAIN;
             return -1;
         }
diff --git a/nexus/WifiScanner.cpp b/nexus/WifiScanner.cpp
index 9854ddc..4c956ac 100644
--- a/nexus/WifiScanner.cpp
+++ b/nexus/WifiScanner.cpp
@@ -58,13 +58,13 @@
     char c = 0;
 
     if (write(mCtrlPipe[1], &c, 1) != 1) {
-        LOGE("Error writing to control pipe (%s)", strerror(errno));
+        ALOGE("Error writing to control pipe (%s)", strerror(errno));
         return -1;
     }
 
     void *ret;
     if (pthread_join(mThread, &ret)) {
-        LOGE("Error joining to scanner thread (%s)", strerror(errno));
+        ALOGE("Error joining to scanner thread (%s)", strerror(errno));
         return -1;
     }
 
@@ -92,7 +92,7 @@
         }
 
         if ((rc = select(mCtrlPipe[0] + 1, &read_fds, NULL, NULL, &to)) < 0) {
-            LOGE("select failed (%s) - sleeping for one scanner period", strerror(errno));
+            ALOGE("select failed (%s) - sleeping for one scanner period", strerror(errno));
             sleep(mPeriod);
             continue;
         } else if (!rc) {
diff --git a/nexus/WifiStatusPoller.cpp b/nexus/WifiStatusPoller.cpp
index e938fd0..015af5d 100644
--- a/nexus/WifiStatusPoller.cpp
+++ b/nexus/WifiStatusPoller.cpp
@@ -50,13 +50,13 @@
     char c = 0;
 
     if (write(mCtrlPipe[1], &c, 1) != 1) {
-        LOGE("Error writing to control pipe (%s)", strerror(errno));
+        ALOGE("Error writing to control pipe (%s)", strerror(errno));
         return -1;
     }
 
     void *ret;
     if (pthread_join(mThread, &ret)) {
-        LOGE("Error joining to listener thread (%s)", strerror(errno));
+        ALOGE("Error joining to listener thread (%s)", strerror(errno));
         return -1;
     }
     close(mCtrlPipe[0]);
@@ -92,7 +92,7 @@
         max = mCtrlPipe[0];
 
         if ((rc = select(max + 1, &read_fds, NULL, NULL, &to)) < 0) {
-            LOGE("select failed (%s)", strerror(errno));
+            ALOGE("select failed (%s)", strerror(errno));
             sleep(1);
             continue;
         } else if (!rc) {
diff --git a/nexus/main.cpp b/nexus/main.cpp
index 5d21067..7d2af02 100644
--- a/nexus/main.cpp
+++ b/nexus/main.cpp
@@ -34,7 +34,7 @@
 
     NetworkManager *nm;
     if (!(nm = NetworkManager::Instance())) {
-        LOGE("Unable to create NetworkManager");
+        ALOGE("Unable to create NetworkManager");
         exit (-1);
     };
 
@@ -47,12 +47,12 @@
 
 
     if (NetworkManager::Instance()->run()) {
-        LOGE("Unable to Run NetworkManager (%s)", strerror(errno));
+        ALOGE("Unable to Run NetworkManager (%s)", strerror(errno));
         exit (1);
     }
 
     if (cl->startListener()) {
-        LOGE("Unable to start CommandListener (%s)", strerror(errno));
+        ALOGE("Unable to start CommandListener (%s)", strerror(errno));
         exit (1);
     }