annotate OIC_LOG_BUFFER when looking for client callback and observer
authorJaewook Jung <jw0213.jung@samsung.com>
Wed, 28 Sep 2016 01:40:45 +0000 (10:40 +0900)
committerAshok Babu Channa <ashok.channa@samsung.com>
Thu, 13 Oct 2016 12:09:16 +0000 (12:09 +0000)
Printing all token info while looking for client callback or observer
is burden and makes it hard to see entire log message
even though it is needless.

Change-Id: I25e0c3f1922f207a9d6652017495270db34e6bbc
Signed-off-by: Jaewook Jung <jw0213.jung@samsung.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/12375
Tested-by: jenkins-iotivity <jenkins-iotivity@opendaylight.org>
Reviewed-by: Ashok Babu Channa <ashok.channa@samsung.com>
(cherry picked from commit ce6822710a2ee2272b2740e6747f219c8c51dfca)
Reviewed-on: https://gerrit.iotivity.org/gerrit/13209
Reviewed-by: Jaehong Jo <jaehong.jo@samsung.com>
resource/csdk/stack/src/occlientcb.c
resource/csdk/stack/src/ocobserve.c

index 054129f..40912b4 100644 (file)
@@ -224,13 +224,13 @@ ClientCB* GetClientCB(const CAToken_t token, uint8_t tokenLength,
     {
         OIC_LOG (INFO, TAG,  "Looking for token");
         OIC_LOG_BUFFER(INFO, TAG, (const uint8_t *)token, tokenLength);
-        OIC_LOG(INFO, TAG, "\tFound in callback list");
         LL_FOREACH(cbList, out)
         {
-            OIC_LOG_BUFFER(INFO, TAG, (const uint8_t *)out->token, tokenLength);
-
+            /* de-annotate below line if want to see all token in cbList */
+            //OIC_LOG_BUFFER(INFO, TAG, (const uint8_t *)out->token, tokenLength);
             if (memcmp(out->token, token, tokenLength) == 0)
             {
+                OIC_LOG(INFO, TAG, "Found in callback list");
                 return out;
             }
             CheckAndDeleteTimedOutCB(out);
@@ -238,10 +238,12 @@ ClientCB* GetClientCB(const CAToken_t token, uint8_t tokenLength,
     }
     else if (handle)
     {
+        OIC_LOG (INFO, TAG,  "Looking for handle");
         LL_FOREACH(cbList, out)
         {
             if (out->handle == handle)
             {
+                OIC_LOG(INFO, TAG, "Found in callback list");
                 return out;
             }
             CheckAndDeleteTimedOutCB(out);
@@ -252,9 +254,11 @@ ClientCB* GetClientCB(const CAToken_t token, uint8_t tokenLength,
         OIC_LOG_V(INFO, TAG, "Looking for uri %s", requestUri);
         LL_FOREACH(cbList, out)
         {
-            OIC_LOG_V(INFO, TAG, "\tFound %s", out->requestUri);
+            /* de-annotate below line if want to see all uri in cbList */
+            //OIC_LOG_V(INFO, TAG, "%s", out->requestUri);
             if (out->requestUri && strcmp(out->requestUri, requestUri ) == 0)
             {
+                OIC_LOG(INFO, TAG, "Found in callback list");
                 return out;
             }
             CheckAndDeleteTimedOutCB(out);
index 3e0a9ba..ea8fea9 100644 (file)
@@ -445,19 +445,19 @@ ResourceObserver* GetObserverUsingId (const OCObservationId observeId)
 
 ResourceObserver* GetObserverUsingToken (const CAToken_t token, uint8_t tokenLength)
 {
-    ResourceObserver *out = NULL;
-
     if (token)
     {
         OIC_LOG(INFO, TAG, "Looking for token");
         OIC_LOG_BUFFER(INFO, TAG, (const uint8_t *)token, tokenLength);
-        OIC_LOG(INFO, TAG, "\tFound token:");
 
+        ResourceObserver *out = NULL;
         LL_FOREACH (g_serverObsList, out)
         {
-            OIC_LOG_BUFFER(INFO, TAG, (const uint8_t *)out->token, tokenLength);
+            /* de-annotate below line if want to see all token in cbList */
+            //OIC_LOG_BUFFER(INFO, TAG, (const uint8_t *)out->token, tokenLength);
             if ((memcmp(out->token, token, tokenLength) == 0))
             {
+                OIC_LOG(INFO, TAG, "Found in observer list");
                 return out;
             }
         }