-fixes
[oweals/gnunet.git] / src / util / test_common_logging_dummy.c
index d87f56d42047877dfe23fbafa69b78f9cfd2765e..a1f479976c83ae0aa02a1bde7161e1070986a672 100644 (file)
  * @author LRN
  */
 #include "platform.h"
+#undef GNUNET_EXTRA_LOGGING
+#define GNUNET_EXTRA_LOGGING GNUNET_YES
+
 #include "gnunet_common.h"
 #include "gnunet_time_lib.h"
 #include "gnunet_network_lib.h"
 
-#define MS200 GNUNET_TIME_relative_multiply(GNUNET_TIME_UNIT_MILLISECONDS, 200)
+/**
+ * Delay introduced between operations, useful for debugging.
+ */
+#define OUTPUT_DELAY GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_MILLISECONDS, 0)
 
 static void
 my_log (void *ctx, enum GNUNET_ErrorType kind, const char *component,
-       const char *date, const char *msg)
+        const char *date, const char *msg)
 {
   if (strncmp ("test-common-logging-dummy", component, 25) != 0)
     return;
-  fprintf (stdout, "%s", msg);
+  FPRINTF (stdout, "%s", msg);
   fflush (stdout);
 }
 
 static int
 expensive_func ()
 {
-  return GNUNET_NETWORK_socket_select (NULL, NULL, NULL, MS200);
+  return GNUNET_NETWORK_socket_select (NULL, NULL, NULL, OUTPUT_DELAY);
 }
 
 #define pr(kind,lvl) {\
@@ -87,6 +93,6 @@ main (int argc, char *argv[])
   pr2 (GNUNET_ERROR_TYPE_INFO, "INFO");
   pr2 (GNUNET_ERROR_TYPE_DEBUG, "DEBUG");
   return 0;
-}                              /* end of main */
+}                               /* end of main */
 
 /* end of test_common_logging_dummy.c */