diff --git a/common.cpp b/common.cpp
index 6a4ea1a..b28a815 100755
--- a/common.cpp
+++ b/common.cpp
@@ -65,8 +65,9 @@
         info->event_cb[info->num_event_cb].vendor_subcmd  = 0;
         info->event_cb[info->num_event_cb].cb_func = func;
         info->event_cb[info->num_event_cb].cb_arg  = arg;
+        /*
         ALOGI("Successfully added event handler %p:%p for command %d at %d",
-                arg, func, cmd, info->num_event_cb);
+                arg, func, cmd, info->num_event_cb);*/
         info->num_event_cb++;
         result = WIFI_SUCCESS;
     }
@@ -83,19 +84,20 @@
 //ALOGD("GSCAN register handle wifi_register_vendor_handler %p", handle);
     /* TODO: check for multiple handlers? */
     pthread_mutex_lock(&info->cb_lock);
-        ALOGI("Added event handler %p", info);
+    //ALOGI("Added event handler %p", info);
 
     wifi_error result = WIFI_ERROR_OUT_OF_MEMORY;
 
-	//    ALOGD("register_vendor_handler: handle = %p", handle);
+    //    ALOGD("register_vendor_handler: handle = %p", handle);
     if (info->num_event_cb < info->alloc_event_cb) {
         info->event_cb[info->num_event_cb].nl_cmd  = NL80211_CMD_VENDOR;
         info->event_cb[info->num_event_cb].vendor_id  = id;
         info->event_cb[info->num_event_cb].vendor_subcmd  = subcmd;
         info->event_cb[info->num_event_cb].cb_func = func;
         info->event_cb[info->num_event_cb].cb_arg  = arg;
+        /*
         ALOGI("Added event handler %p:%p for vendor 0x%0x and subcmd 0x%0x at %d",
-                arg, func, id, subcmd, info->num_event_cb);
+                arg, func, id, subcmd, info->num_event_cb);*/
         info->num_event_cb++;
         result = WIFI_SUCCESS;
     }
@@ -117,8 +119,9 @@
 
     for (int i = 0; i < info->num_event_cb; i++) {
         if (info->event_cb[i].nl_cmd == cmd) {
+            /*
             ALOGI("Successfully removed event handler %p:%p for cmd = 0x%0x from %d",
-                    info->event_cb[i].cb_arg, info->event_cb[i].cb_func, cmd, i);
+                    info->event_cb[i].cb_arg, info->event_cb[i].cb_func, cmd, i);*/
 
             memmove(&info->event_cb[i], &info->event_cb[i+1],
                 (info->num_event_cb - i - 1) * sizeof(cb_info));
@@ -141,8 +144,9 @@
         if (info->event_cb[i].nl_cmd == NL80211_CMD_VENDOR
                 && info->event_cb[i].vendor_id == id
                 && info->event_cb[i].vendor_subcmd == subcmd) {
+            /*
             ALOGI("Successfully removed event handler %p:%p for vendor 0x%0x, subcmd 0x%0x from %d",
-                    info->event_cb[i].cb_arg, info->event_cb[i].cb_func, id, subcmd, i);
+                    info->event_cb[i].cb_arg, info->event_cb[i].cb_func, id, subcmd, i);*/
             memmove(&info->event_cb[i], &info->event_cb[i+1],
                 (info->num_event_cb - i - 1) * sizeof(cb_info));
             info->num_event_cb--;
@@ -158,14 +162,14 @@
 {
     hal_info *info = (hal_info *)handle;
 
-    ALOGD("registering command %d", id);
+    //ALOGD("registering command %d", id);
 
     wifi_error result = WIFI_ERROR_OUT_OF_MEMORY;
 
     if (info->num_cmd < info->alloc_cmd) {
         info->cmd[info->num_cmd].id   = id;
         info->cmd[info->num_cmd].cmd  = cmd;
-        ALOGI("Successfully added command %d: %p at %d", id, cmd, info->num_cmd);
+        //ALOGI("Successfully added command %d: %p at %d", id, cmd, info->num_cmd);
         info->num_cmd++;
         result = WIFI_SUCCESS;
     }
@@ -177,7 +181,7 @@
 {
     hal_info *info = (hal_info *)handle;
 
-    ALOGD("un-registering command %d", id);
+    //ALOGD("un-registering command %d", id);
 
     WifiCommand *cmd = NULL;
 
@@ -186,7 +190,7 @@
             cmd = info->cmd[i].cmd;
             memmove(&info->cmd[i], &info->cmd[i+1], (info->num_cmd - i) * sizeof(cmd_info));
             info->num_cmd--;
-            ALOGI("Successfully removed command %d: %p from %d", id, cmd, i);
+            //ALOGI("Successfully removed command %d: %p from %d", id, cmd, i);
             break;
         }
     }
@@ -219,7 +223,7 @@
             int id = info->cmd[i].id;
             memmove(&info->cmd[i], &info->cmd[i+1], (info->num_cmd - i) * sizeof(cmd_info));
             info->num_cmd--;
-            ALOGI("Successfully removed command %d: %p from %d", id, cmd, i);
+            //ALOGI("Successfully removed command %d: %p from %d", id, cmd, i);
             break;
         }
     }
@@ -230,7 +234,7 @@
 	wifi_handle handle = getWifiHandle(iface);
 
 	WifiCommand *cmd = wifi_unregister_cmd(handle, id);
-	ALOGD("Cancel WifiCommand = %p", cmd);
+	//ALOGD("Cancel WifiCommand = %p", cmd);
 	if (cmd) {
 		cmd->cancel();
 		cmd->releaseRef();
diff --git a/cpp_bindings.h b/cpp_bindings.h
index 0864d87..d1e1e5a 100755
--- a/cpp_bindings.h
+++ b/cpp_bindings.h
@@ -261,7 +261,7 @@
 
     virtual int create() {
         /* by default there is no way to cancel */
-        ALOGD("WifiCommand %p can't be created", this);
+        //ALOGD("WifiCommand %p can't be created", this);
         return WIFI_ERROR_NOT_SUPPORTED;
     }
 
diff --git a/gscan.cpp b/gscan.cpp
index 3c6d104..90989f9 100755
--- a/gscan.cpp
+++ b/gscan.cpp
@@ -143,7 +143,7 @@
     virtual int handleResponse(WifiEvent& reply) {
 
         if (reply.get_cmd() != NL80211_CMD_VENDOR) {
-            ALOGD("Ignoring reply with cmd = %d", reply.get_cmd());
+            ALOGE("Ignoring reply with cmd = %d", reply.get_cmd());
             return NL_SKIP;
         }
 
@@ -202,7 +202,7 @@
     virtual int handleResponse(WifiEvent& reply) {
 
         if (reply.get_cmd() != NL80211_CMD_VENDOR) {
-            ALOGD("Ignoring reply with cmd = %d", reply.get_cmd());
+            ALOGE("Ignoring reply with cmd = %d", reply.get_cmd());
             return NL_SKIP;
         }
 
@@ -477,7 +477,7 @@
     }
 
     virtual int handleEvent(WifiEvent& event) {
-        event.log();
+        //event.log();
 
         nlattr *vendor_data = event.get_attribute(NL80211_ATTR_VENDOR_DATA);
         unsigned int len = event.get_vendor_data_len();
@@ -507,7 +507,7 @@
             if (scan_result) {
                 if(*mHandler.on_full_scan_result)
                     (*mHandler.on_full_scan_result)(id(), scan_result, bucket_scanned);
-
+/*
                     ALOGD("%-32s\t", scan_result->ssid);
                     ALOGD("%02x:%02x:%02x:%02x:%02x:%02x ", scan_result->bssid[0], scan_result->bssid[1],
                             scan_result->bssid[2], scan_result->bssid[3], scan_result->bssid[4], scan_result->bssid[5]);
@@ -516,6 +516,7 @@
                     ALOGD("%lld\t", scan_result->ts);
                     ALOGD("%lld\t", scan_result->rtt);
                     ALOGD("%lld\n", scan_result->rtt_sd);
+*/
             }
         }
         return NL_SKIP;
@@ -635,7 +636,7 @@
     virtual int handleResponse(WifiEvent& reply) {
 
         if (reply.get_cmd() != NL80211_CMD_VENDOR) {
-            ALOGD("Ignoring reply with cmd = %d", reply.get_cmd());
+            ALOGE("Ignoring reply with cmd = %d", reply.get_cmd());
             return NL_SKIP;
         }
 
@@ -653,19 +654,19 @@
         for (nl_iterator it(vendor_data); it.has_next(); it.next()) {
             if (it.get_type() == GSCAN_ATTRIBUTE_SCAN_RESULTS_COMPLETE) {
                 mCompleted = it.get_u8();
-                ALOGD("retrieved mCompleted flag : %d", mCompleted);
+                //ALOGD("retrieved mCompleted flag : %d", mCompleted);
             } else if (it.get_type() == GSCAN_ATTRIBUTE_SCAN_RESULTS || it.get_type() == 0) {
                 int scan_id = 0, flags = 0, num = 0;
                 for (nl_iterator it2(it.get()); it2.has_next(); it2.next()) {
                     if (it2.get_type() == GSCAN_ATTRIBUTE_SCAN_ID) {
                         scan_id = it2.get_u32();
-                        ALOGD("retrieved scan_id : 0x%0x", scan_id);
+                        //ALOGD("retrieved scan_id : 0x%0x", scan_id);
                     } else if (it2.get_type() == GSCAN_ATTRIBUTE_SCAN_FLAGS) {
                         flags = it2.get_u8();
-                        ALOGD("retrieved scan_flags : 0x%0x", flags);
+                        //ALOGD("retrieved scan_flags : 0x%0x", flags);
                     } else if (it2.get_type() == GSCAN_ATTRIBUTE_NUM_OF_RESULTS) {
                         num = it2.get_u32();
-                        ALOGD("retrieved num_results: %d", num);
+                        //ALOGD("retrieved num_results: %d", num);
                     } else if (it2.get_type() == GSCAN_ATTRIBUTE_SCAN_RESULTS) {
                         if (mRetrieved >= mMax) {
                             ALOGW("Stored %d scans, ignoring excess results", mRetrieved);
@@ -676,19 +677,19 @@
                         num = min((int)MAX_AP_CACHE_PER_SCAN, num);
                         memcpy(mScanResults + mNextScanResult, it2.get_data(),
                                 sizeof(wifi_scan_result) * num);
-                        ALOGD("Retrieved %d scan results", num);
                         wifi_scan_result *results = (wifi_scan_result *)it2.get_data();
+                        /*
                         for (int i = 0; i < num; i++) {
                             wifi_scan_result *result = results + i;
                             ALOGD("%02d  %-32s  %02x:%02x:%02x:%02x:%02x:%02x  %04d", i,
                                 result->ssid, result->bssid[0], result->bssid[1], result->bssid[2],
                                 result->bssid[3], result->bssid[4], result->bssid[5],
                                 result->rssi);
-                        }
+                        }*/
                         mScans[mRetrieved].scan_id = scan_id;
                         mScans[mRetrieved].flags = flags;
                         mScans[mRetrieved].num_results = num;
-                        ALOGD("Setting result of scan_id : 0x%0x", mScans[mRetrieved].scan_id);
+                        //ALOGD("Setting result of scan_id : 0x%0x", mScans[mRetrieved].scan_id);
                         memcpy(mScans[mRetrieved].results,
                                 &(mScanResults[mNextScanResult]), num * sizeof(wifi_scan_result));
                         mNextScanResult += num;
@@ -788,7 +789,7 @@
 
         result = requestResponse(request);
         if (result < 0) {
-            ALOGD("Failed to execute hotlist setup request, result = %d", result);
+            ALOGE("Failed to execute hotlist setup request, result = %d", result);
             unregisterVendorHandler(GOOGLE_OUI, GSCAN_EVENT_HOTLIST_RESULTS_FOUND);
             unregisterVendorHandler(GOOGLE_OUI, GSCAN_EVENT_HOTLIST_RESULTS_LOST);
             return result;
@@ -826,7 +827,7 @@
 
     virtual int handleEvent(WifiEvent& event) {
         int event_id = event.get_vendor_subcmd();
-        event.log();
+        //event.log();
 
         nlattr *vendor_data = event.get_attribute(NL80211_ATTR_VENDOR_DATA);
         int len = event.get_vendor_data_len();
@@ -974,7 +975,7 @@
 
         result = requestResponse(request);
         if (result < 0) {
-            ALOGD("failed to set significant wifi change %d", result);
+            ALOGE("failed to set significant wifi change %d", result);
             return result;
         }
         registerVendorHandler(GOOGLE_OUI, GSCAN_EVENT_SIGNIFICANT_CHANGE_RESULTS);
diff --git a/wifi_hal.cpp b/wifi_hal.cpp
index c6c7f02..937a6e0 100755
--- a/wifi_hal.cpp
+++ b/wifi_hal.cpp
@@ -405,8 +405,9 @@
     if (cmd == NL80211_CMD_VENDOR) {
         vendor_id = event.get_u32(NL80211_ATTR_VENDOR_ID);
         subcmd = event.get_u32(NL80211_ATTR_VENDOR_SUBCMD);
+        /*
         ALOGI("event received %s, vendor_id = 0x%0x, subcmd = 0x%0x",
-                event.get_cmdString(), vendor_id, subcmd);
+                event.get_cmdString(), vendor_id, subcmd);*/
     }
 
      //ALOGI("event received %s, vendor_id = 0x%0x", event.get_cmdString(), vendor_id);
