[network-manager-applet] nm-applet: change logging to use g_debug



commit b44069bd7aafa779ef23747964f30e868fa16550
Author: Dan Winship <danw gnome org>
Date:   Sun Oct 20 16:03:50 2013 -0400

    nm-applet: change logging to use g_debug
    
    and define a log domain so you can use G_MESSAGES_DEBUG=nm-applet to
    enable them.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=709419

 src/Makefile.am |    1 +
 src/applet.c    |   19 +++++++++++--------
 2 files changed, 12 insertions(+), 8 deletions(-)
---
diff --git a/src/Makefile.am b/src/Makefile.am
index 44554cf..5a48c3d 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -15,6 +15,7 @@ nm_applet_CPPFLAGS = \
        -DAUTOSTARTDIR=\""$(sysconfdir)/xdg/autostart"\"                        \
        -DVPN_NAME_FILES_DIR=\""$(sysconfdir)/NetworkManager/VPN"\"     \
        -DNMALOCALEDIR=\"$(datadir)/locale\"                                    \
+       -DG_LOG_DOMAIN=\""nm-applet"\" \
        $(DBUS_CFLAGS)                                                                          \
        $(DISABLE_DEPRECATED)   \
        -I${top_builddir}/src/marshallers \
diff --git a/src/applet.c b/src/applet.c
index 1c04bcf..a0fef8b 100644
--- a/src/applet.c
+++ b/src/applet.c
@@ -263,7 +263,7 @@ get_device_class (NMDevice *device, NMApplet *applet)
                else if (caps & NM_DEVICE_MODEM_CAPABILITY_CDMA_EVDO)
                        return applet->cdma_class;
                else
-                       g_message ("%s: unhandled modem capabilities 0x%X", __func__, caps);
+                       g_debug ("%s: unhandled modem capabilities 0x%X", __func__, caps);
        } else if (NM_IS_DEVICE_BT (device))
                return applet->bt_class;
        else if (NM_IS_DEVICE_WIMAX (device))
@@ -2578,9 +2578,9 @@ foo_manager_running_cb (NMClient *client,
        NMApplet *applet = NM_APPLET (user_data);
 
        if (nm_client_get_manager_running (client)) {
-               g_message ("NM appeared");
+               g_debug ("NM appeared");
        } else {
-               g_message ("NM disappeared");
+               g_debug ("NM disappeared");
                clear_animation_timeout (applet);
        }
 
@@ -3423,9 +3423,7 @@ status_icon_size_changed_cb (GtkStatusIcon *icon,
                              gint size,
                              NMApplet *applet)
 {
-       if (getenv ("NMA_SIZE_DEBUG")) {
-               g_message ("%s(): status icon size %d requested", __func__, size);
-       }
+       g_debug ("%s(): status icon size %d requested", __func__, size);
 
        /* icon_size may be 0 if for example the panel hasn't given us any space
         * yet.  We'll get resized later, but for now just load the 16x16 icons.
@@ -3515,8 +3513,8 @@ applet_embedded_cb (GObject *object, GParamSpec *pspec, gpointer user_data)
 {
        gboolean embedded = gtk_status_icon_is_embedded (GTK_STATUS_ICON (object));
 
-       g_message ("applet now %s the notification area",
-                  embedded ? "embedded in" : "removed from");
+       g_debug ("applet now %s the notification area",
+                embedded ? "embedded in" : "removed from");
 }
 
 static void
@@ -3525,7 +3523,11 @@ shell_version_changed_cb (NMShellWatcher *watcher, GParamSpec *pspec, gpointer u
        NMApplet *applet = user_data;
 
        if (nm_shell_watcher_version_at_least (watcher, 3, 0)) {
+               g_debug ("gnome-shell is running");
+
                if (applet->agent) {
+                       g_debug ("destroying secret agent");
+
                        g_signal_handlers_disconnect_by_func (applet->agent,
                                                              G_CALLBACK (applet_agent_get_secrets_cb),
                                                              applet);
@@ -3543,6 +3545,7 @@ shell_version_changed_cb (NMShellWatcher *watcher, GParamSpec *pspec, gpointer u
                g_clear_object (&applet->shell_watcher);
        } else {
                /* No shell */
+               g_debug ("gnome-shell is not running, registering secret agent");
 
                applet->agent = applet_agent_new ();
                g_assert (applet->agent);


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