fix logging
authorChristian Grothoff <christian@grothoff.org>
Sat, 3 Mar 2018 20:23:50 +0000 (21:23 +0100)
committerChristian Grothoff <christian@grothoff.org>
Sat, 3 Mar 2018 20:23:50 +0000 (21:23 +0100)
src/util/client.c
src/util/mq.c
src/util/scheduler.c

index 7a718fc8d49d1acb1c73829263845e37a696fb7c..3479fa971da6d6a9e70ecb862527bd2d2e27a160 100644 (file)
@@ -261,11 +261,11 @@ transmit_ready (void *cls)
   pos = (const char *) cstate->msg;
   len = ntohs (cstate->msg->size);
   GNUNET_assert (cstate->msg_off < len);
-  GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
-              "client: message of type %u trying to send with socket %p (MQ: %p\n",
-              ntohs(cstate->msg->type),
-              cstate->sock,
-              cstate->mq);
+  LOG (GNUNET_ERROR_TYPE_DEBUG,
+       "message of type %u trying to send with socket %p (MQ: %p\n",
+       ntohs(cstate->msg->type),
+       cstate->sock,
+       cstate->mq);
 
  RETRY:
   ret = GNUNET_NETWORK_socket_send (cstate->sock,
@@ -273,13 +273,13 @@ transmit_ready (void *cls)
                                     len - cstate->msg_off);
   if (-1 == ret)
   {
-    GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
-                "client: error during sending message of type %u\n",
-                ntohs(cstate->msg->type));
+    LOG (GNUNET_ERROR_TYPE_WARNING,
+         "Error during sending message of type %u\n",
+         ntohs(cstate->msg->type));
     if (EINTR == errno){
-      GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
-                  "client: retrying message of type %u\n",
-                  ntohs(cstate->msg->type));
+      LOG (GNUNET_ERROR_TYPE_DEBUG,
+           "Retrying message of type %u\n",
+           ntohs(cstate->msg->type));
       goto RETRY;
     }
     GNUNET_MQ_inject_error (cstate->mq,
@@ -290,9 +290,9 @@ transmit_ready (void *cls)
   cstate->msg_off += ret;
   if (cstate->msg_off < len)
   {
-    GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
-                "client: rescheduling message of type %u\n",
-                ntohs(cstate->msg->type));
+    LOG (GNUNET_ERROR_TYPE_DEBUG,
+         "rescheduling message of type %u\n",
+         ntohs(cstate->msg->type));
     cstate->send_task
       = GNUNET_SCHEDULER_add_write_net (GNUNET_TIME_UNIT_FOREVER_REL,
                                         cstate->sock,
@@ -302,9 +302,9 @@ transmit_ready (void *cls)
       GNUNET_MQ_impl_send_in_flight (cstate->mq);
     return;
   }
-  GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
-              "client: sending message of type %u successful\n",
-              ntohs(cstate->msg->type));
+  LOG (GNUNET_ERROR_TYPE_DEBUG,
+       "sending message of type %u successful\n",
+       ntohs(cstate->msg->type));
   cstate->msg = NULL;
   GNUNET_MQ_impl_send_continue (cstate->mq);
 }
@@ -394,9 +394,9 @@ connection_client_destroy_impl (struct GNUNET_MQ_Handle *mq,
   if (NULL != cstate->retry_task)
     GNUNET_SCHEDULER_cancel (cstate->retry_task);
   if (NULL != cstate->sock){
-    GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
-                "client: destroying socket: %p\n",
-                cstate->sock);
+    LOG (GNUNET_ERROR_TYPE_DEBUG,
+         "destroying socket: %p\n",
+         cstate->sock);
     GNUNET_NETWORK_socket_close (cstate->sock);
   }
   cancel_aps (cstate);
@@ -822,9 +822,9 @@ connection_client_send_impl (struct GNUNET_MQ_Handle *mq,
   cstate->msg = msg;
   cstate->msg_off = 0;
   if (NULL == cstate->sock){
-    GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
-                "client: message of type %u waiting for socket\n",
-                ntohs(msg->type));
+    LOG (GNUNET_ERROR_TYPE_DEBUG,
+         "message of type %u waiting for socket\n",
+         ntohs(msg->type));
     return; /* still waiting for connection */
    }
   cstate->send_task
index 33bbaa6ad42531e5eea69cd4ca19f646ace774cf..af700836c50ebf169075a7ca34465c4d03df611c 100644 (file)
@@ -358,10 +358,10 @@ GNUNET_MQ_send (struct GNUNET_MQ_Handle *mq,
   GNUNET_assert (NULL == mq->envelope_head);
   mq->current_envelope = ev;
 
-  GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
-              "mq: sending message of type %u, queue empty (MQ: %p)\n",
-              ntohs(ev->mh->type),
-              mq);
+  LOG (GNUNET_ERROR_TYPE_DEBUG,
+       "sending message of type %u, queue empty (MQ: %p)\n",
+       ntohs(ev->mh->type),
+       mq);
 
   mq->send_impl (mq,
                 ev->mh,
@@ -459,9 +459,9 @@ impl_send_continue (void *cls)
                               mq->envelope_tail,
                               mq->current_envelope);
 
-  GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
-              "mq: sending message of type %u from queue\n",
-              ntohs(mq->current_envelope->mh->type));
+  LOG (GNUNET_ERROR_TYPE_DEBUG,
+       "sending message of type %u from queue\n",
+       ntohs(mq->current_envelope->mh->type));
 
   mq->send_impl (mq,
                 mq->current_envelope->mh,
@@ -851,9 +851,9 @@ GNUNET_MQ_destroy (struct GNUNET_MQ_Handle *mq)
                                 ev);
     GNUNET_assert (0 < mq->queue_length);
     mq->queue_length--;
-    GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
-                "MQ destroy drops message of type %u\n",
-                ntohs (ev->mh->type));
+    LOG (GNUNET_ERROR_TYPE_DEBUG,
+         "MQ destroy drops message of type %u\n",
+         ntohs (ev->mh->type));
     GNUNET_MQ_discard (ev);
   }
   if (NULL != mq->current_envelope)
@@ -861,9 +861,9 @@ GNUNET_MQ_destroy (struct GNUNET_MQ_Handle *mq)
     /* we can only discard envelopes that
      * are not queued! */
     mq->current_envelope->parent_queue = NULL;
-    GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
-                "MQ destroy drops current message of type %u\n",
-                ntohs (mq->current_envelope->mh->type));
+    LOG (GNUNET_ERROR_TYPE_DEBUG,
+         "MQ destroy drops current message of type %u\n",
+         ntohs (mq->current_envelope->mh->type));
     GNUNET_MQ_discard (mq->current_envelope);
     mq->current_envelope = NULL;
     GNUNET_assert (0 < mq->queue_length);
@@ -946,9 +946,9 @@ GNUNET_MQ_send_cancel (struct GNUNET_MQ_Envelope *ev)
                                    mq->envelope_tail,
                                    mq->current_envelope);
 
-      GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
-                  "mq: sending canceled message of type %u queue\n",
-                  ntohs(ev->mh->type));
+      LOG (GNUNET_ERROR_TYPE_DEBUG,
+           "sending canceled message of type %u queue\n",
+           ntohs(ev->mh->type));
 
       mq->send_impl (mq,
                     mq->current_envelope->mh,
index 7c1a8326a136d2b5c33327dd4aebf99548d86132..e00ca444b8ef7213b5c33162bf32137f4cb2b298 100644 (file)
@@ -520,8 +520,8 @@ GNUNET_SCHEDULER_shutdown ()
 {
   struct GNUNET_SCHEDULER_Task *pos;
 
-  GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
-              "GNUNET_SCHEDULER_shutdown\n");
+  LOG (GNUNET_ERROR_TYPE_DEBUG,
+       "GNUNET_SCHEDULER_shutdown\n");
   if (NULL != install_parent_control_task)
   {
     GNUNET_SCHEDULER_cancel (install_parent_control_task);
@@ -2023,9 +2023,9 @@ GNUNET_SCHEDULER_do_work (struct GNUNET_SCHEDULER_Handle *sh)
        * waiting for the timeout, so we handle this gracefully. It might
        * also be a programming error in the driver though.
        */
-      GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
-                  "GNUNET_SCHEDULER_do_work did not find any ready "
-                  "tasks and timeout has not been reached yet.\n");
+      LOG (GNUNET_ERROR_TYPE_DEBUG,
+           "GNUNET_SCHEDULER_do_work did not find any ready "
+           "tasks and timeout has not been reached yet.\n");
       return GNUNET_NO;
     }
     /**
@@ -2376,8 +2376,8 @@ select_loop (struct GNUNET_SCHEDULER_Handle *sh, struct DriverContext *context)
     }
     if (GNUNET_YES == GNUNET_SCHEDULER_do_work (sh))
     {
-      GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
-                  "scheduler has more tasks ready!\n");
+      LOG (GNUNET_ERROR_TYPE_DEBUG,
+           "scheduler has more tasks ready!\n");
     }
   }
   GNUNET_NETWORK_fdset_destroy (rs);