[gnome-photos] Use the new debug setup
- From: Debarshi Ray <debarshir src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-photos] Use the new debug setup
- Date: Wed, 18 Feb 2015 10:20:42 +0000 (UTC)
commit dbbd159678b20cd79430d013933c1b51dd182f99
Author: Pranav Kant <pranav913 gmail com>
Date: Sun Feb 15 15:29:28 2015 +0530
Use the new debug setup
Replaces all g_debug with photos_debug along with appropriate flags.
https://bugzilla.gnome.org/show_bug.cgi?id=744305
src/gegl-gtk-view-helper.c | 4 +++-
src/photos-dlna-renderer.c | 3 ++-
src/photos-dlna-renderers-manager.c | 21 ++++++++++++---------
src/photos-facebook-item.c | 5 +++--
src/photos-flickr-item.c | 5 +++--
src/photos-google-item.c | 5 +++--
src/photos-main.c | 3 +++
src/photos-media-server-item.c | 3 ++-
src/photos-tracker-controller.c | 7 +++++--
src/photos-tracker-queue.c | 3 ++-
10 files changed, 38 insertions(+), 21 deletions(-)
---
diff --git a/src/gegl-gtk-view-helper.c b/src/gegl-gtk-view-helper.c
index c9a842e..6c501bf 100644
--- a/src/gegl-gtk-view-helper.c
+++ b/src/gegl-gtk-view-helper.c
@@ -22,6 +22,8 @@
#include <math.h>
#include <babl/babl.h>
+#include "photos-debug.h"
+
G_DEFINE_TYPE(ViewHelper, view_helper, G_TYPE_OBJECT)
@@ -266,7 +268,7 @@ view_helper_draw(ViewHelper *self, cairo_t *cr, GdkRectangle *rect)
GEGL_BLIT_CACHE | (self->block ? 0 : GEGL_BLIT_DIRTY));
end = g_get_monotonic_time ();
- g_debug ("Node Blit: %" G_GINT64_FORMAT, end - start);
+ photos_debug (PHOTOS_DEBUG_GEGL, "Node Blit: %" G_GINT64_FORMAT, end - start);
surface = cairo_image_surface_create_for_data(buf,
CAIRO_FORMAT_ARGB32,
diff --git a/src/photos-dlna-renderer.c b/src/photos-dlna-renderer.c
index 0a97e2c..774a294 100644
--- a/src/photos-dlna-renderer.c
+++ b/src/photos-dlna-renderer.c
@@ -22,6 +22,7 @@
#include "config.h"
+#include "photos-debug.h"
#include "photos-dleyna-renderer-device.h"
#include "photos-dleyna-renderer-push-host.h"
#include "photos-dlna-renderer.h"
@@ -430,7 +431,7 @@ photos_dlna_renderer_share_host_file_cb (GObject *source_object,
g_object_notify (G_OBJECT (self), "shared-count");
/* 2) Mpris.Player.OpenUri(hosted_url) */
- g_debug ("%s %s", G_STRFUNC, hosted_url);
+ photos_debug (PHOTOS_DEBUG_DLNA, "%s %s", G_STRFUNC, hosted_url);
mpris_player_call_open_uri (priv->player, hosted_url,
g_task_get_cancellable (task),
photos_dlna_renderer_share_open_uri_cb,
diff --git a/src/photos-dlna-renderers-manager.c b/src/photos-dlna-renderers-manager.c
index 23272df..1159d7e 100644
--- a/src/photos-dlna-renderers-manager.c
+++ b/src/photos-dlna-renderers-manager.c
@@ -22,6 +22,7 @@
#include <gio/gio.h>
+#include "photos-debug.h"
#include "photos-dleyna-renderer-manager.h"
#include "photos-dlna-renderers-manager.h"
#include "photos-dlna-renderer.h"
@@ -84,10 +85,11 @@ photos_dlna_renderers_manager_renderer_new_cb (GObject *source_object,
}
object_path = photos_dlna_renderer_get_object_path (renderer);
- g_debug ("%s '%s' %s %s", G_STRFUNC,
- photos_dlna_renderer_get_friendly_name (renderer),
- photos_dlna_renderer_get_udn (renderer),
- object_path);
+ photos_debug (PHOTOS_DEBUG_DLNA,
+ "%s '%s' %s %s", G_STRFUNC,
+ photos_dlna_renderer_get_friendly_name (renderer),
+ photos_dlna_renderer_get_udn (renderer),
+ object_path);
g_hash_table_insert (priv->renderers, (gpointer) object_path, renderer);
g_signal_emit (self, signals[RENDERER_FOUND], 0, renderer);
}
@@ -120,10 +122,11 @@ photos_dlna_renderers_manager_renderer_lost_cb (PhotosDlnaRenderersManager *self
g_return_if_fail (renderer != NULL);
g_hash_table_steal (priv->renderers, object_path);
- g_debug ("%s '%s' %s %s", G_STRFUNC,
- photos_dlna_renderer_get_friendly_name (renderer),
- photos_dlna_renderer_get_udn (renderer),
- object_path);
+ photos_debug (PHOTOS_DEBUG_DLNA,
+ "%s '%s' %s %s", G_STRFUNC,
+ photos_dlna_renderer_get_friendly_name (renderer),
+ photos_dlna_renderer_get_udn (renderer),
+ object_path);
g_signal_emit (self, signals[RENDERER_LOST], 0, renderer);
g_object_unref (renderer);
}
@@ -171,7 +174,7 @@ photos_dlna_renderers_manager_proxy_new_cb (GObject *source_object,
return;
}
- g_debug ("%s DLNA renderers manager initialized", G_STRFUNC);
+ photos_debug (PHOTOS_DEBUG_DLNA, "%s DLNA renderers manager initialized", G_STRFUNC);
g_signal_connect_swapped (priv->proxy, "found-renderer",
G_CALLBACK (photos_dlna_renderers_manager_renderer_found_cb), self);
diff --git a/src/photos-facebook-item.c b/src/photos-facebook-item.c
index 8f3600f..4229d91 100644
--- a/src/photos-facebook-item.c
+++ b/src/photos-facebook-item.c
@@ -35,6 +35,7 @@
#include <libgnome-desktop/gnome-desktop-thumbnail.h>
#include "photos-base-manager.h"
+#include "photos-debug.h"
#include "photos-facebook-item.h"
#include "photos-search-context.h"
#include "photos-source.h"
@@ -135,7 +136,7 @@ photos_facebook_item_create_thumbnail (PhotosBaseItem *item, GCancellable *cance
local_dir = g_path_get_dirname (local_path);
g_mkdir_with_parents (local_dir, 0700);
- g_debug ("Downloading %s from Facebook to %s", thumbnail_image->source, local_path);
+ photos_debug (PHOTOS_DEBUG_NETWORK, "Downloading %s from Facebook to %s", thumbnail_image->source,
local_path);
if (!g_file_copy (remote_file,
local_file,
G_FILE_COPY_ALL_METADATA | G_FILE_COPY_OVERWRITE,
@@ -191,7 +192,7 @@ photos_facebook_item_download (PhotosBaseItem *item, GCancellable *cancellable,
local_file = g_file_new_for_path (local_filename);
- g_debug ("Downloading %s from Facebook to %s", higher_image->source, local_filename);
+ photos_debug (PHOTOS_DEBUG_NETWORK, "Downloading %s from Facebook to %s", higher_image->source,
local_filename);
if (!g_file_copy (remote_file,
local_file,
G_FILE_COPY_ALL_METADATA | G_FILE_COPY_OVERWRITE,
diff --git a/src/photos-flickr-item.c b/src/photos-flickr-item.c
index 279367d..e4b6a2f 100644
--- a/src/photos-flickr-item.c
+++ b/src/photos-flickr-item.c
@@ -35,6 +35,7 @@
#include <libgnome-desktop/gnome-desktop-thumbnail.h>
#include "photos-base-manager.h"
+#include "photos-debug.h"
#include "photos-flickr-item.h"
#include "photos-search-context.h"
#include "photos-source.h"
@@ -222,7 +223,7 @@ photos_flickr_item_create_thumbnail (PhotosBaseItem *item, GCancellable *cancell
local_dir = g_path_get_dirname (local_path);
g_mkdir_with_parents (local_dir, 0700);
- g_debug ("Downloading %s from Flickr to %s", thumbnail_uri, local_path);
+ photos_debug (PHOTOS_DEBUG_NETWORK, "Downloading %s from Flickr to %s", thumbnail_uri, local_path);
if (!g_file_copy (remote_file,
local_file,
G_FILE_COPY_ALL_METADATA | G_FILE_COPY_OVERWRITE,
@@ -276,7 +277,7 @@ photos_flickr_item_download (PhotosBaseItem *item, GCancellable *cancellable, GE
if (!g_file_test (local_path, G_FILE_TEST_EXISTS))
{
- g_debug ("Downloading %s from Flickr to %s", uri, local_path);
+ photos_debug (PHOTOS_DEBUG_NETWORK, "Downloading %s from Flickr to %s", uri, local_path);
if (!g_file_copy (remote_file,
local_file,
G_FILE_COPY_ALL_METADATA | G_FILE_COPY_OVERWRITE,
diff --git a/src/photos-google-item.c b/src/photos-google-item.c
index 13b59b7..a5eb27b 100644
--- a/src/photos-google-item.c
+++ b/src/photos-google-item.c
@@ -33,6 +33,7 @@
#include <libgnome-desktop/gnome-desktop-thumbnail.h>
#include "photos-base-manager.h"
+#include "photos-debug.h"
#include "photos-google-item.h"
#include "photos-search-context.h"
#include "photos-source.h"
@@ -168,7 +169,7 @@ photos_google_item_create_thumbnail (PhotosBaseItem *item, GCancellable *cancell
local_dir = g_path_get_dirname (local_path);
g_mkdir_with_parents (local_dir, 0700);
- g_debug ("Downloading %s from Google to %s", thumbnail_uri, local_path);
+ photos_debug (PHOTOS_DEBUG_NETWORK, "Downloading %s from Google to %s", thumbnail_uri, local_path);
if (!g_file_copy (remote_file,
local_file,
G_FILE_COPY_ALL_METADATA | G_FILE_COPY_OVERWRITE,
@@ -220,7 +221,7 @@ photos_google_item_download (PhotosBaseItem *item, GCancellable *cancellable, GE
if (!g_file_test (local_path, G_FILE_TEST_EXISTS))
{
- g_debug ("Downloading %s from Google to %s", uri, local_path);
+ photos_debug (PHOTOS_DEBUG_NETWORK, "Downloading %s from Google to %s", uri, local_path);
if (!g_file_copy (remote_file,
local_file,
G_FILE_COPY_ALL_METADATA | G_FILE_COPY_OVERWRITE,
diff --git a/src/photos-main.c b/src/photos-main.c
index 203d1b1..071cc79 100644
--- a/src/photos-main.c
+++ b/src/photos-main.c
@@ -31,6 +31,7 @@
#include <glib/gi18n.h>
#include "photos-application.h"
+#include "photos-debug.h"
#include "photos-remote-display-manager.h"
@@ -43,6 +44,8 @@ main (gint argc, gchar *argv[])
setlocale (LC_ALL, "");
+ photos_debug_init ();
+
bindtextdomain (GETTEXT_PACKAGE, PACKAGE_LOCALE_DIR);
bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8");
textdomain (GETTEXT_PACKAGE);
diff --git a/src/photos-media-server-item.c b/src/photos-media-server-item.c
index b8fb61e..908b7b3 100644
--- a/src/photos-media-server-item.c
+++ b/src/photos-media-server-item.c
@@ -32,6 +32,7 @@
#include <glib.h>
#include "photos-base-manager.h"
+#include "photos-debug.h"
#include "photos-media-server-item.h"
#include "photos-search-context.h"
#include "photos-source.h"
@@ -102,7 +103,7 @@ photos_media_server_item_download (PhotosBaseItem *item, GCancellable *cancellab
if (!g_file_test (local_path, G_FILE_TEST_EXISTS))
{
- g_debug ("Downloading %s from Media Server to %s", uri, local_path);
+ photos_debug (PHOTOS_DEBUG_NETWORK, "Downloading %s from Media Server to %s", uri, local_path);
if (!g_file_copy (remote_file,
local_file,
G_FILE_COPY_ALL_METADATA | G_FILE_COPY_OVERWRITE,
diff --git a/src/photos-tracker-controller.c b/src/photos-tracker-controller.c
index 4952c8d..c4a4501 100644
--- a/src/photos-tracker-controller.c
+++ b/src/photos-tracker-controller.c
@@ -31,6 +31,7 @@
#include <gio/gio.h>
#include "photos-base-manager.h"
+#include "photos-debug.h"
#include "photos-enums.h"
#include "photos-filterable.h"
#include "photos-item-manager.h"
@@ -141,7 +142,7 @@ photos_tracker_controller_cursor_next (GObject *source_object, GAsyncResult *res
}
now = g_get_monotonic_time ();
- g_debug ("Query Cursor: %" G_GINT64_FORMAT, (now - priv->last_query_time) / 1000000);
+ photos_debug (PHOTOS_DEBUG_TRACKER, "Query Cursor: %" G_GINT64_FORMAT, (now - priv->last_query_time) /
1000000);
photos_item_manager_add_item (PHOTOS_ITEM_MANAGER (priv->item_mngr), cursor);
tracker_sparql_cursor_next_async (cursor,
@@ -223,7 +224,9 @@ photos_tracker_controller_set_query_status (PhotosTrackerController *self, gbool
priv->last_query_time = now;
else
{
- g_debug ("Query Elapsed: %" G_GINT64_FORMAT, (now - priv->last_query_time) / 1000000);
+ photos_debug (PHOTOS_DEBUG_TRACKER,
+ "Query Elapsed: %" G_GINT64_FORMAT,
+ (now - priv->last_query_time) / 1000000);
priv->last_query_time = 0;
}
diff --git a/src/photos-tracker-queue.c b/src/photos-tracker-queue.c
index 28a3794..abbf1ac 100644
--- a/src/photos-tracker-queue.c
+++ b/src/photos-tracker-queue.c
@@ -28,6 +28,7 @@
#include <glib.h>
#include <tracker-sparql.h>
+#include "photos-debug.h"
#include "photos-tracker-queue.h"
@@ -137,7 +138,7 @@ photos_tracker_queue_check (PhotosTrackerQueue *self)
data = g_queue_peek_head (priv->queue);
priv->running = TRUE;
- g_debug ("%s", data->sparql);
+ photos_debug (PHOTOS_DEBUG_TRACKER, "%s", data->sparql);
switch (data->query_type)
{
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]