Reduce log clutter.

Change-Id: Ia034b563b028d74b4878f1af7db9188c82d03548
diff --git a/core/jni/android_nfc.h b/core/jni/android_nfc.h
index df660f2..de0ddde 100644
--- a/core/jni/android_nfc.h
+++ b/core/jni/android_nfc.h
@@ -22,8 +22,17 @@
 #ifndef __ANDROID_NFC_H__
 #define __ANDROID_NFC_H__
 
+#define LOG_TAG "NdefMessage"
+#include <utils/Log.h>
+
 extern "C" {
 
+#if 0
+  #define TRACE(...) LOG(LOG_DEBUG, "NdefMessage", __VA_ARGS__)
+#else
+  #define TRACE(...)
+#endif
+
 typedef struct phFriNfc_NdefRecord {
     uint8_t                 Flags;
     uint8_t                 Tnf;
diff --git a/core/jni/android_nfc_NdefMessage.cpp b/core/jni/android_nfc_NdefMessage.cpp
index eaf989d..9beef2a 100644
--- a/core/jni/android_nfc_NdefMessage.cpp
+++ b/core/jni/android_nfc_NdefMessage.cpp
@@ -14,8 +14,6 @@
  * limitations under the License.
  */
 
-#define LOG_TAG "NdefMessage"
-
 #include <stdlib.h>
 
 #include "jni.h"
@@ -23,8 +21,6 @@
 
 #include "android_nfc.h"
 
-#include <utils/Log.h>
-
 namespace android {
 
 static jint android_nfc_NdefMessage_parseNdefMessage(JNIEnv *e, jobject o,
@@ -53,7 +49,7 @@
         return -1;
 
     /* Get the number of records in the message so we can allocate buffers */
-    LOGD("phFriNfc_NdefRecord_GetRecords(NULL)");
+    TRACE("phFriNfc_NdefRecord_GetRecords(NULL)");
 
     status = phFriNfc_NdefRecord_GetRecords((uint8_t *)raw_msg,
             (uint32_t)raw_msg_size, NULL, NULL, &num_of_records);
@@ -62,9 +58,7 @@
         LOGE("phFriNfc_NdefRecord_GetRecords(NULL) returned 0x%04x", status);
         goto end;
     }
-    LOGD("phFriNfc_NdefRecord_GetRecords(NULL) returned 0x%04x", status);
-
-    LOGD("found %d records in message", num_of_records);
+    TRACE("phFriNfc_NdefRecord_GetRecords(NULL) returned 0x%04x, with %d records", status, num_of_records);
 
     is_chunked = (uint8_t*)malloc(num_of_records);
     if (is_chunked == NULL)
@@ -74,7 +68,7 @@
         goto end;
 
     /* Now, actually retrieve records position in message */
-    LOGD("phFriNfc_NdefRecord_GetRecords()");
+    TRACE("phFriNfc_NdefRecord_GetRecords()");
 
     status = phFriNfc_NdefRecord_GetRecords((uint8_t *)raw_msg,
             (uint32_t)raw_msg_size, records, is_chunked, &num_of_records);
@@ -83,7 +77,7 @@
         LOGE("phFriNfc_NdefRecord_GetRecords() returned 0x%04x", status);
         goto end;
     }
-    LOGD("phFriNfc_NdefRecord_GetRecords() returned 0x%04x", status);
+    TRACE("phFriNfc_NdefRecord_GetRecords() returned 0x%04x, with %d records", status, num_of_records);
 
     /* Build NDEF records array */
     record_cls = e->FindClass("android/nfc/NdefRecord");
@@ -94,13 +88,11 @@
 
     ctor = e->GetMethodID(record_cls, "<init>", "(S[B[B[B)V");
 
-    LOGD("NFC_Number of records = %d\n", num_of_records);
-
     for (i = 0; i < num_of_records; i++) {
         jbyteArray type, id, payload;
         jobject new_record;
 
-        LOGD("phFriNfc_NdefRecord_Parse()");
+        TRACE("phFriNfc_NdefRecord_Parse()");
 
         status = phFriNfc_NdefRecord_Parse(&record, records[i]);
 
@@ -108,7 +100,7 @@
             LOGE("phFriNfc_NdefRecord_Parse() returned 0x%04x", status);
             goto end;
         }
-        LOGD("phFriNfc_NdefRecord_Parse() returned 0x%04x", status);
+        TRACE("phFriNfc_NdefRecord_Parse() returned 0x%04x", status);
 
         type = e->NewByteArray(record.TypeLength);
         if (type == NULL) {
diff --git a/core/jni/android_nfc_NdefRecord.cpp b/core/jni/android_nfc_NdefRecord.cpp
index 0a3a519..a7a80c8 100644
--- a/core/jni/android_nfc_NdefRecord.cpp
+++ b/core/jni/android_nfc_NdefRecord.cpp
@@ -54,7 +54,7 @@
     if (buf == NULL)
         goto end;
 
-    LOGD("phFriNfc_NdefRecord_Generate()");
+    TRACE("phFriNfc_NdefRecord_Generate()");
 
     status = phFriNfc_NdefRecord_Generate(&record, buf, buf_size,
             &record_size);
@@ -63,7 +63,7 @@
         LOGE("phFriNfc_NdefRecord_Generate() returned 0x%04x", status);
         goto end;
     }
-    LOGD("phFriNfc_NdefRecord_Generate() returned 0x%04x", status);
+    TRACE("phFriNfc_NdefRecord_Generate() returned 0x%04x", status);
 
     result = e->NewByteArray(record_size);
     if (result == NULL)
@@ -104,13 +104,13 @@
         goto clean_and_return;
     }
 
-    LOGD("phFriNfc_NdefRecord_Parse()");
+    TRACE("phFriNfc_NdefRecord_Parse()");
     status = phFriNfc_NdefRecord_Parse(&record, (uint8_t *)raw_record);
     if (status) {
         LOGE("phFriNfc_NdefRecord_Parse() returned 0x%04x", status);
         goto clean_and_return;
     }
-    LOGD("phFriNfc_NdefRecord_Parse() returned 0x%04x", status);
+    TRACE("phFriNfc_NdefRecord_Parse() returned 0x%04x", status);
 
     /* Set TNF field */
     mTnf = e->GetFieldID(record_cls, "mTnf", "S");