[network-manager-applet/danw/agent: 2/2] nm-applet: change logging to use g_debug
- From: Dan Winship <danw src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [network-manager-applet/danw/agent: 2/2] nm-applet: change logging to use g_debug
- Date: Sun, 20 Oct 2013 20:06:09 +0000 (UTC)
commit 6c49e961bce746a884b8de54cf00ac97724a7e25
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 | 17 +++++++++++------
2 files changed, 12 insertions(+), 6 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..dfea837 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);
}
@@ -3424,7 +3424,7 @@ status_icon_size_changed_cb (GtkStatusIcon *icon,
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
@@ -3515,8 +3515,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 +3525,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 +3547,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]