]> git.ipfire.org Git - thirdparty/shairport-sync.git/commitdiff
Quieten some debug messages and make others a bit more informative
authorMike Brady <mikebrady@eircom.net>
Mon, 19 Feb 2018 20:55:35 +0000 (20:55 +0000)
committerMike Brady <mikebrady@eircom.net>
Mon, 19 Feb 2018 20:55:35 +0000 (20:55 +0000)
dbus-service.c
mpris-service.c

index 545c97659ccd87ecc4a78f90e78d79417aa8807d..f030bd8438e2e69c5a3084f7bb50b07845db76b2 100644 (file)
@@ -151,7 +151,7 @@ static gboolean on_handle_remote_command(ShairportSync *skeleton, GDBusMethodInv
 static void on_dbus_name_acquired(GDBusConnection *connection, const gchar *name,
                                   gpointer user_data) {
 
-  debug(1, "Well-known interface name \"%s\" acquired for %s.", name, config.appName);
+  // debug(1, "Shairport Sync native D-Bus interface \"%s\" acquired on the %s bus.", name, (config.dbus_service_bus_type == DBT_session) ? "session" : "system");
   shairportSyncSkeleton = shairport_sync_skeleton_new();
 
   g_dbus_interface_skeleton_export(G_DBUS_INTERFACE_SKELETON(shairportSyncSkeleton), connection,
@@ -177,25 +177,25 @@ static void on_dbus_name_acquired(GDBusConnection *connection, const gchar *name
                    NULL);
   g_signal_connect(shairportSyncSkeleton, "handle-remote-command",
                    G_CALLBACK(on_handle_remote_command), NULL);
-  debug(1, "Shairport Sync D-BUS service started on interface \"%s\".", name);
+  debug(1, "Shairport Sync native D-Bus service started at \"%s\" on the %s bus.", name, (config.dbus_service_bus_type == DBT_session) ? "session" : "system");
 }
 
 static void on_dbus_name_lost_again(GDBusConnection *connection, const gchar *name,
                                     gpointer user_data) {
-  warn("Could not acquire an Shairport Sync D-BUS interface.");
+  warn("Could not acquire a Shairport Sync native D-Bus interface \"%s\" on the %s bus.", name, (config.dbus_service_bus_type == DBT_session) ? "session" : "system");
 }
 
 static void on_dbus_name_lost(GDBusConnection *connection, const gchar *name, gpointer user_data) {
-  debug(1, "Could not acquire well-known interface name \"%s\" -- will try adding the process "
-           "number to the end of it.",
-        name);
+  //debug(1, "Could not acquire a Shairport Sync native D-Bus interface \"%s\" on the %s bus -- will try adding the process "
+  //         "number to the end of it.",
+  //      name, (config.dbus_service_bus_type == DBT_session) ? "session" : "system");
   pid_t pid = getpid();
   char interface_name[256] = "";
   sprintf(interface_name, "org.gnome.ShairportSync.i%d", pid);
   GBusType dbus_bus_type = G_BUS_TYPE_SYSTEM;
   if (config.dbus_service_bus_type == DBT_session)
     dbus_bus_type = G_BUS_TYPE_SESSION;
-  debug(1, "Looking for well-known interface name \"%s\".", interface_name);
+  //debug(1, "Looking for a Shairport Sync native D-Bus interface \"%s\" on the %s bus.", interface_name,(config.dbus_service_bus_type == DBT_session) ? "session" : "system");
   g_bus_own_name(dbus_bus_type, interface_name, G_BUS_NAME_OWNER_FLAGS_NONE, NULL,
                  on_dbus_name_acquired, on_dbus_name_lost_again, NULL, NULL);
 }
@@ -205,7 +205,7 @@ int start_dbus_service() {
   GBusType dbus_bus_type = G_BUS_TYPE_SYSTEM;
   if (config.dbus_service_bus_type == DBT_session)
     dbus_bus_type = G_BUS_TYPE_SESSION;
 debug(1, "Looking for well-known name \"org.gnome.ShairportSync\".");
// debug(1, "Looking for a Shairport Sync native D-Bus interface \"org.gnome.ShairportSync\" on the %s bus.",(config.dbus_service_bus_type == DBT_session) ? "session" : "system");
   g_bus_own_name(dbus_bus_type, "org.gnome.ShairportSync", G_BUS_NAME_OWNER_FLAGS_NONE, NULL,
                  on_dbus_name_acquired, on_dbus_name_lost, NULL, NULL);
   return 0; // this is just to quieten a compiler warning
index 4da7decb80c3a12a48723b0b083425a2f9abc149..ed7e68ee7a837628426d4ef9581841d4edc97e0c 100644 (file)
@@ -166,7 +166,7 @@ static void on_mpris_name_acquired(GDBusConnection *connection, const gchar *nam
 
   const char *empty_string_array[] = {NULL};
 
-  debug(1, "MPRIS well-known interface name \"%s\" acquired for %s.", name, config.appName);
+  // debug(1, "MPRIS well-known interface name \"%s\" acquired on the %s bus.", name, (config.mpris_service_bus_type == DBT_session) ? "session" : "system");
   mprisPlayerSkeleton = media_player2_skeleton_new();
   mprisPlayerPlayerSkeleton = media_player2_player_skeleton_new();
 
@@ -206,30 +206,25 @@ static void on_mpris_name_acquired(GDBusConnection *connection, const gchar *nam
 
   add_metadata_watcher(mpris_metadata_watcher, NULL);
 
-  debug(1, "Shairport Sync D-BUS service started on interface \"%s\".", name);
-
-  debug(1, "MPRIS service started on interface \"%s\".", name);
+  debug(1, "MPRIS service started at \"%s\" on the %s bus.", name, (config.mpris_service_bus_type == DBT_session) ? "session" : "system");
 }
 
 static void on_mpris_name_lost_again(GDBusConnection *connection, const gchar *name,
                                      gpointer user_data) {
-  warn("Could not acquire an MPRIS interface.");
+  warn("Could not acquire an MPRIS interface named \"%s\" on the %s bus.",name,(config.mpris_service_bus_type == DBT_session) ? "session" : "system");
 }
 
 static void on_mpris_name_lost(GDBusConnection *connection, const gchar *name, gpointer user_data) {
-  debug(1, "Could not acquire well-known interface name \"%s\" -- will try adding the process "
-           "number to the end of it.",
-        name);
+  //debug(1, "Could not acquire MPRIS interface \"%s\" on the %s bus -- will try adding the process "
+  //         "number to the end of it.",
+  //      name,(mpris_bus_type==G_BUS_TYPE_SESSION) ? "session" : "system");
   pid_t pid = getpid();
   char interface_name[256] = "";
   sprintf(interface_name, "org.mpris.MediaPlayer2.ShairportSync.i%d", pid);
   GBusType mpris_bus_type = G_BUS_TYPE_SYSTEM;
   if (config.mpris_service_bus_type == DBT_session)
     mpris_bus_type = G_BUS_TYPE_SESSION;
-  if (mpris_bus_type == G_BUS_TYPE_SYSTEM)
-    debug(1, "Looking for well-known interface name \"%s\" on the system bus.", interface_name);
-  else
-    debug(1, "Looking for well-known interface name \"%s\" on the session bus.", interface_name);
+  // debug(1, "Looking for an MPRIS interface \"%s\" on the %s bus.",interface_name, (mpris_bus_type==G_BUS_TYPE_SESSION) ? "session" : "system");
   g_bus_own_name(mpris_bus_type, interface_name, G_BUS_NAME_OWNER_FLAGS_NONE, NULL,
                  on_mpris_name_acquired, on_mpris_name_lost_again, NULL, NULL);
 }
@@ -240,7 +235,7 @@ int start_mpris_service() {
   GBusType mpris_bus_type = G_BUS_TYPE_SYSTEM;
   if (config.mpris_service_bus_type == DBT_session)
     mpris_bus_type = G_BUS_TYPE_SESSION;
-  debug(1, "Looking for well-known name \"org.mpris.MediaPlayer2.ShairportSync\".");
+  // debug(1, "Looking for an MPRIS interface \"org.mpris.MediaPlayer2.ShairportSync\" on the %s bus.",(mpris_bus_type==G_BUS_TYPE_SESSION) ? "session" : "system");
   g_bus_own_name(mpris_bus_type, "org.mpris.MediaPlayer2.ShairportSync",
                  G_BUS_NAME_OWNER_FLAGS_NONE, NULL, on_mpris_name_acquired, on_mpris_name_lost,
                  NULL, NULL);