tracker r2904 - in trunk: . src/libtracker-common src/tracker-extract



Author: mr
Date: Mon Feb  9 12:38:59 2009
New Revision: 2904
URL: http://svn.gnome.org/viewvc/tracker?rev=2904&view=rev

Log:
	* src/tracker-extract/tracker-extract.c: Use the new DBus debug
	function so we don't spam the logs in EVERY log verbosity mode.
	This makes quite an impact on indexing time with verbosity set to 3.


Modified:
   trunk/ChangeLog
   trunk/src/libtracker-common/tracker-dbus.c
   trunk/src/libtracker-common/tracker-dbus.h
   trunk/src/tracker-extract/tracker-escape.c
   trunk/src/tracker-extract/tracker-escape.h
   trunk/src/tracker-extract/tracker-extract.c

Modified: trunk/src/libtracker-common/tracker-dbus.c
==============================================================================
--- trunk/src/libtracker-common/tracker-dbus.c	(original)
+++ trunk/src/libtracker-common/tracker-dbus.c	Mon Feb  9 12:38:59 2009
@@ -330,3 +330,21 @@
 		   str);
 	g_free (str);
 }
+
+void
+tracker_dbus_request_debug (gint	 request_id,
+			    const gchar *format,
+			    ...)
+{
+	gchar	*str;
+	va_list  args;
+
+	va_start (args, format);
+	str = g_strdup_vprintf (format, args);
+	va_end (args);
+
+	g_debug ("---- [%d] %s",
+		 request_id,
+		 str);
+	g_free (str);
+}

Modified: trunk/src/libtracker-common/tracker-dbus.h
==============================================================================
--- trunk/src/libtracker-common/tracker-dbus.h	(original)
+++ trunk/src/libtracker-common/tracker-dbus.h	Mon Feb  9 12:38:59 2009
@@ -117,6 +117,9 @@
 void		 tracker_dbus_request_comment	     (gint			  request_id,
 						      const gchar		 *format,
 						      ...);
+void		 tracker_dbus_request_debug	     (gint			  request_id,
+						      const gchar		 *format,
+						      ...);
 
 G_END_DECLS
 

Modified: trunk/src/tracker-extract/tracker-escape.c
==============================================================================
--- trunk/src/tracker-extract/tracker-escape.c	(original)
+++ trunk/src/tracker-extract/tracker-escape.c	Mon Feb  9 12:38:59 2009
@@ -26,6 +26,8 @@
 
 #include "tracker-escape.h"
 
+#ifdef SHOULD_VALIDATE_UTF8
+
 gchar *
 tracker_escape_metadata (const gchar *str)
 {
@@ -54,3 +56,5 @@
  	
  	return escaped;
 }
+
+#endif /* SHOULD_VALIDATE_UTF8 */

Modified: trunk/src/tracker-extract/tracker-escape.h
==============================================================================
--- trunk/src/tracker-extract/tracker-escape.h	(original)
+++ trunk/src/tracker-extract/tracker-escape.h	Mon Feb  9 12:38:59 2009
@@ -23,12 +23,24 @@
 
 #include <glib.h>
 
+#undef SHOULD_VALIDATE_UTF8
+
 G_BEGIN_DECLS
 
+#ifdef SHOULD_VALIDATE_UTF8
+
+gchar *tracker_escape_metadata        (const gchar *str);
+gchar *tracker_escape_metadata_printf (const gchar *format,
+				       ...);
+
+#else  /* SHOULD_VALIDATE_UTF8 */
+
 /* We used to escape strings before we used DBus */
 #define tracker_escape_metadata        g_strdup
 #define tracker_escape_metadata_printf g_strdup_printf
 
+#endif /* SHOULD_VALIDATE_UTF8 */
+
 G_END_DECLS
 
 #endif /* __TRACKER_ESCAPE_H__ */

Modified: trunk/src/tracker-extract/tracker-extract.c
==============================================================================
--- trunk/src/tracker-extract/tracker-extract.c	(original)
+++ trunk/src/tracker-extract/tracker-extract.c	Mon Feb  9 12:38:59 2009
@@ -180,10 +180,10 @@
 
 	if (value_utf8) {
 		value_utf8 = g_strstrip (value_utf8);
-		tracker_dbus_request_comment (GPOINTER_TO_UINT (user_data),
-					      "  Found '%s'='%s'",
-					      key,
-					      value_utf8);
+		tracker_dbus_request_debug (GPOINTER_TO_UINT (user_data),
+					    "  Found '%s'='%s'",
+					    key,
+					    value_utf8);
 		g_free (value_utf8);
 	}
 }
@@ -355,9 +355,9 @@
 				  path,
 				  mime);
 
-	tracker_dbus_request_comment (request_id,
-				      "  Resetting shutdown timeout");
-
+	tracker_dbus_request_debug (request_id,
+				    "  Resetting shutdown timeout");
+	
 	tracker_main_shutdown_timeout_reset ();
 
 	values = get_file_metadata (object, request_id, path, mime);



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]