[nautilus/desktop-files-scripts-all-the-things-i-can-no-longer-run] directory-async: Use Nautilus debug logger



commit 14b734b34a5939174246f1de41bee81dbe680af6
Author: Ernestas Kulik <ernestask gnome org>
Date:   Sat May 12 18:29:48 2018 +0300

    directory-async: Use Nautilus debug logger
    
    This will help avoid some of the spam.

 src/nautilus-debug.c           |  1 +
 src/nautilus-debug.h           | 33 +++++++++++++++++----------------
 src/nautilus-directory-async.c | 15 +++++++++------
 3 files changed, 27 insertions(+), 22 deletions(-)
---
diff --git a/src/nautilus-debug.c b/src/nautilus-debug.c
index 63318d072..84c247327 100644
--- a/src/nautilus-debug.c
+++ b/src/nautilus-debug.c
@@ -36,6 +36,7 @@ static gboolean initialized = FALSE;
 static GDebugKey keys[] =
 {
     { "Application", NAUTILUS_DEBUG_APPLICATION },
+    { "AsyncJobs", NAUTILUS_DEBUG_ASYNC_JOBS },
     { "Bookmarks", NAUTILUS_DEBUG_BOOKMARKS },
     { "DBus", NAUTILUS_DEBUG_DBUS },
     { "DirectoryView", NAUTILUS_DEBUG_DIRECTORY_VIEW },
diff --git a/src/nautilus-debug.h b/src/nautilus-debug.h
index cabf89f71..4cbfc0f91 100644
--- a/src/nautilus-debug.h
+++ b/src/nautilus-debug.h
@@ -30,22 +30,23 @@ G_BEGIN_DECLS
 
 typedef enum {
   NAUTILUS_DEBUG_APPLICATION = 1 << 1,
-  NAUTILUS_DEBUG_BOOKMARKS = 1 << 2,
-  NAUTILUS_DEBUG_DBUS = 1 << 3,
-  NAUTILUS_DEBUG_DIRECTORY_VIEW = 1 << 4,
-  NAUTILUS_DEBUG_FILE = 1 << 5,
-  NAUTILUS_DEBUG_CANVAS_CONTAINER = 1 << 6,
-  NAUTILUS_DEBUG_CANVAS_VIEW = 1 << 7,
-  NAUTILUS_DEBUG_LIST_VIEW = 1 << 8,
-  NAUTILUS_DEBUG_MIME = 1 << 9,
-  NAUTILUS_DEBUG_PLACES = 1 << 10,
-  NAUTILUS_DEBUG_PREVIEWER = 1 << 11,
-  NAUTILUS_DEBUG_SMCLIENT = 1 << 12,
-  NAUTILUS_DEBUG_WINDOW = 1 << 13,
-  NAUTILUS_DEBUG_UNDO = 1 << 14,
-  NAUTILUS_DEBUG_SEARCH = 1 << 15,
-  NAUTILUS_DEBUG_SEARCH_HIT = 1 << 16,
-  NAUTILUS_DEBUG_THUMBNAILS = 1 << 17,
+  NAUTILUS_DEBUG_ASYNC_JOBS = 1 << 2,
+  NAUTILUS_DEBUG_BOOKMARKS = 1 << 3,
+  NAUTILUS_DEBUG_DBUS = 1 << 4,
+  NAUTILUS_DEBUG_DIRECTORY_VIEW = 1 << 5,
+  NAUTILUS_DEBUG_FILE = 1 << 6,
+  NAUTILUS_DEBUG_CANVAS_CONTAINER = 1 << 7,
+  NAUTILUS_DEBUG_CANVAS_VIEW = 1 << 8,
+  NAUTILUS_DEBUG_LIST_VIEW = 1 << 9,
+  NAUTILUS_DEBUG_MIME = 1 << 10,
+  NAUTILUS_DEBUG_PLACES = 1 << 11,
+  NAUTILUS_DEBUG_PREVIEWER = 1 << 12,
+  NAUTILUS_DEBUG_SMCLIENT = 1 << 13,
+  NAUTILUS_DEBUG_WINDOW = 1 << 14,
+  NAUTILUS_DEBUG_UNDO = 1 << 15,
+  NAUTILUS_DEBUG_SEARCH = 1 << 16,
+  NAUTILUS_DEBUG_SEARCH_HIT = 1 << 17,
+  NAUTILUS_DEBUG_THUMBNAILS = 1 << 18,
 } DebugFlags;
 
 void nautilus_debug_set_flags (DebugFlags flags);
diff --git a/src/nautilus-directory-async.c b/src/nautilus-directory-async.c
index ab3f0dc32..c3d236cf4 100644
--- a/src/nautilus-directory-async.c
+++ b/src/nautilus-directory-async.c
@@ -21,6 +21,9 @@
 
 #include <config.h>
 
+#define DEBUG_FLAG NAUTILUS_DEBUG_ASYNC_JOBS
+
+#include "nautilus-debug.h"
 #include "nautilus-directory-notify.h"
 #include "nautilus-directory-private.h"
 #include "nautilus-file-attributes.h"
@@ -341,7 +344,7 @@ async_job_start (NautilusDirectory *directory,
     char *key;
 #endif
 
-    g_debug ("starting %s in %p", job, directory->details->location);
+    DEBUG ("starting %s in %p", job, directory->details->location);
 
     g_assert (async_job_count >= 0);
     g_assert (async_job_count <= MAX_ASYNC_JOBS);
@@ -393,7 +396,7 @@ async_job_end (NautilusDirectory *directory,
     gpointer table_key, value;
 #endif
 
-    g_debug ("stopping %s in %p", job, directory->details->location);
+    DEBUG ("stopping %s in %p", job, directory->details->location);
 
     g_assert (async_job_count > 0);
 
@@ -2202,7 +2205,7 @@ start_monitoring_file_list (NautilusDirectory *directory)
     state->load_directory_file->details->loading_directory = TRUE;
 
 
-    g_debug ("load_directory called to monitor file list of %p", directory->details->location);
+    DEBUG ("load_directory called to monitor file list of %p", directory->details->location);
 
     directory->details->directory_load_in_progress = state;
 
@@ -2649,7 +2652,7 @@ directory_count_start (NautilusDirectory *directory,
     {
         g_autofree char *uri = NULL;
         uri = g_file_get_uri (location);
-        g_debug ("load_directory called to get shallow file count for %s", uri);
+        DEBUG ("load_directory called to get shallow file count for %s", uri);
     }
 
     g_file_enumerate_children_async (location,
@@ -2922,7 +2925,7 @@ deep_count_load (DeepCountState *state,
 {
     state->deep_count_location = g_object_ref (location);
 
-    g_debug ("load_directory called to get deep file count for %p", location);
+    DEBUG ("load_directory called to get deep file count for %p", location);
     g_file_enumerate_children_async (state->deep_count_location,
                                      G_FILE_ATTRIBUTE_STANDARD_NAME ","
                                      G_FILE_ATTRIBUTE_STANDARD_TYPE ","
@@ -3313,7 +3316,7 @@ mime_list_start (NautilusDirectory *directory,
     {
         g_autofree char *uri = NULL;
         uri = g_file_get_uri (location);
-        g_debug ("load_directory called to get MIME list of %s", uri);
+        DEBUG ("load_directory called to get MIME list of %s", uri);
     }
 
     g_file_enumerate_children_async (location,


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