[gvfs/sam/afc-monitor-logging] afc: Use g_debug() instead of g_print() for log output



commit 22c02c36bf0a1bc985697f82c1a8192cbb74bcc9
Author: Sam Thursfield <sam afuera me uk>
Date:   Tue Aug 6 21:19:57 2019 +0200

    afc: Use g_debug() instead of g_print() for log output
    
    Daemons shouldn't be printing directly to stdout, but should be using
    the normal GLib logging system. The messages output by this daemon
    will not show by default, but setting `G_MESSAGES_DEBUG=GVFS-AFC` in
    the environment will cause them to appear.

 monitor/afc/afcvolume.c        | 2 +-
 monitor/afc/afcvolumemonitor.c | 6 +++---
 2 files changed, 4 insertions(+), 4 deletions(-)
---
diff --git a/monitor/afc/afcvolume.c b/monitor/afc/afcvolume.c
index 5f52cf16..319e1dfe 100644
--- a/monitor/afc/afcvolume.c
+++ b/monitor/afc/afcvolume.c
@@ -334,7 +334,7 @@ g_vfs_afc_volume_mount (GVolume             *volume,
   ActivationMountOp *data;
   GFile *root;
 
-  g_print ("g_vfs_afc_volume_mount (can_mount=%d uuid=%s)\n",
+  g_debug ("g_vfs_afc_volume_mount (can_mount=%d uuid=%s)",
            g_vfs_afc_volume_can_mount (volume),
            afc_volume->uuid);
 
diff --git a/monitor/afc/afcvolumemonitor.c b/monitor/afc/afcvolumemonitor.c
index ad9007c5..953947e4 100644
--- a/monitor/afc/afcvolumemonitor.c
+++ b/monitor/afc/afcvolumemonitor.c
@@ -26,7 +26,7 @@ g_vfs_afc_monitor_create_volume (GVfsAfcVolumeMonitor *self,
 {
   GVfsAfcVolume *volume = NULL;
 
-  g_print ("creating volume for device uuid '%s'\n", uuid);
+  g_debug ("creating volume for device uuid '%s'\n", uuid);
 
   /* Only add the house arrest volume, the default AFC service
    * doesn't contain anything that users should modify */
@@ -63,7 +63,7 @@ g_vfs_afc_monitor_remove_volume (GVfsAfcVolumeMonitor *self,
   volume = find_volume_by_uuid (self, uuid);
   while (volume != NULL)
     {
-      g_print ("removing volume for device uuid '%s'\n", uuid);
+      g_debug ("removing volume for device uuid '%s'\n", uuid);
       self->volumes = g_list_remove (self->volumes, volume);
       g_signal_emit_by_name (self, "volume-removed", volume);
       g_object_unref (volume);
@@ -102,7 +102,7 @@ g_vfs_afc_volume_monitor_constructor (GType type, guint ncps,
 
   idevice_event_subscribe(g_vfs_afc_monitor_idevice_event, self);
 
-  g_print ("Volume monitor alive\n");
+  g_debug ("Volume monitor alive\n");
 
   return G_OBJECT(self);
 }


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