fix log calls
authorChristian Grothoff <christian@grothoff.org>
Tue, 20 Oct 2009 07:21:07 +0000 (07:21 +0000)
committerChristian Grothoff <christian@grothoff.org>
Tue, 20 Oct 2009 07:21:07 +0000 (07:21 +0000)
src/datastore/datastore_api.c
src/datastore/gnunet-service-datastore.c

index 3e2df3bc03d3bf6e9cca2147e607ecd600c046c2..f6d7480de3dcf2d4ec69b86437d18a8df68ad8d3 100644 (file)
@@ -367,8 +367,9 @@ GNUNET_DATASTORE_put (struct GNUNET_DATASTORE_Handle *h,
 
 #if DEBUG_DATASTORE
   GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
-             "Asked to put %u bytes of data\n",
-             size);
+             "Asked to put %u bytes of data under key `%s'\n",
+             size,
+             GNUNET_h2s (key));
 #endif
   msize = sizeof(struct DataMessage) + size;
   GNUNET_assert (msize <= GNUNET_SERVER_MAX_MESSAGE_SIZE);
@@ -722,6 +723,11 @@ GNUNET_DATASTORE_get (struct GNUNET_DATASTORE_Handle *h,
 {
   struct GetMessage *gm;
 
+#if DEBUG_DATASTORE
+  GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
+             "Asked to look for data under key `%s'\n",
+             GNUNET_h2s (key));
+#endif
   gm = (struct GetMessage*) &h[1];
   gm->header.type = htons(GNUNET_MESSAGE_TYPE_DATASTORE_GET);
   gm->type = htonl(type);
index f80abef0653c54319135d371220cc06a14ebbde8..0fe1263ce4263b02a108eef7197c503a44bafadd 100644 (file)
@@ -849,8 +849,16 @@ handle_put (void *cls,
                          GNUNET_TIME_absolute_ntoh(dm->expiration),
                          &msg);
   if (GNUNET_OK == ret)
-    GNUNET_CONTAINER_bloomfilter_add (filter,
-                                     &dm->key);
+    {
+      GNUNET_CONTAINER_bloomfilter_add (filter,
+                                       &dm->key);
+#if DEBUG_DATASTORE
+      GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
+                 "Successfully stored %u bytes under key `%s'\n",
+                 size,
+                 GNUNET_h2s (&dm->key));
+#endif
+    }
   transmit_status (client, 
                   (GNUNET_SYSERR == ret) ? GNUNET_SYSERR : GNUNET_OK, 
                   msg);
@@ -896,8 +904,9 @@ handle_get (void *cls,
       /* don't bother database... */
 #if DEBUG_DATASTORE
       GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
-                 "Empty result set for `%s' request.\n",
-                 "GET");
+                 "Empty result set for `%s' request for `%s'.\n",
+                 "GET",
+                 GNUNET_h2s (&msg->key));
 #endif 
       GNUNET_SERVER_client_keep (client);
       transmit_item (client,