gdm r6221 - in branches/gnome-2-22: . common daemon
- From: mccann svn gnome org
- To: svn-commits-list gnome org
- Subject: gdm r6221 - in branches/gnome-2-22: . common daemon
- Date: Tue, 6 May 2008 19:16:09 +0100 (BST)
Author: mccann
Date: Tue May 6 18:16:08 2008
New Revision: 6221
URL: http://svn.gnome.org/viewvc/gdm?rev=6221&view=rev
Log:
2008-05-06 William Jon McCann <jmccann redhat com>
* common/gdm-log.c (log_level_to_priority_and_prefix),
(gdm_log_set_debug):
* daemon/factory-slave-main.c (signal_cb), (is_debug_set), (main):
* daemon/product-slave-main.c (signal_cb), (is_debug_set), (main):
* daemon/session-worker-main.c (signal_cb), (is_debug_set), (main):
* daemon/simple-slave-main.c (signal_cb), (is_debug_set), (main):
* daemon/xdmcp-chooser-slave-main.c (signal_cb), (is_debug_set),
(main):
Don't unconditionally enabled debugging.
Modified:
branches/gnome-2-22/ChangeLog
branches/gnome-2-22/common/gdm-log.c
branches/gnome-2-22/daemon/factory-slave-main.c
branches/gnome-2-22/daemon/product-slave-main.c
branches/gnome-2-22/daemon/session-worker-main.c
branches/gnome-2-22/daemon/simple-slave-main.c
branches/gnome-2-22/daemon/xdmcp-chooser-slave-main.c
Modified: branches/gnome-2-22/common/gdm-log.c
==============================================================================
--- branches/gnome-2-22/common/gdm-log.c (original)
+++ branches/gnome-2-22/common/gdm-log.c Tue May 6 18:16:08 2008
@@ -78,10 +78,11 @@
* to ensure it is seen in a log */
if (syslog_levels & G_LOG_LEVEL_DEBUG) {
priority = LOG_WARNING;
+ prefix = "DEBUG(+)";
} else {
priority = LOG_DEBUG;
+ prefix = "DEBUG";
}
- prefix = "DEBUG";
break;
default:
priority = LOG_DEBUG;
@@ -169,7 +170,9 @@
{
if (debug) {
syslog_levels |= G_LOG_LEVEL_DEBUG;
+ g_debug ("Enabling debugging");
} else {
+ g_debug ("Disabling debugging");
syslog_levels &= ~G_LOG_LEVEL_DEBUG;
}
}
Modified: branches/gnome-2-22/daemon/factory-slave-main.c
==============================================================================
--- branches/gnome-2-22/daemon/factory-slave-main.c (original)
+++ branches/gnome-2-22/daemon/factory-slave-main.c Tue May 6 18:16:08 2008
@@ -121,6 +121,8 @@
*/
ret = TRUE;
+ gdm_log_toggle_debug ();
+
break;
default:
@@ -142,6 +144,17 @@
g_main_loop_quit (main_loop);
}
+static gboolean
+is_debug_set (gboolean arg)
+{
+ /* enable debugging for unstable builds */
+ if (gdm_is_version_unstable ()) {
+ return TRUE;
+ }
+
+ return arg;
+}
+
int
main (int argc,
char **argv)
@@ -151,8 +164,10 @@
DBusGConnection *connection;
GdmSlave *slave;
static char *display_id = NULL;
+ static gboolean debug = FALSE;
GdmSignalHandler *signal_handler;
static GOptionEntry entries [] = {
+ { "debug", 0, 0, G_OPTION_ARG_NONE, &debug, N_("Enable debugging code"), NULL },
{ "display-id", 0, 0, G_OPTION_ARG_STRING, &display_id, N_("Display ID"), N_("id") },
{ NULL }
};
@@ -178,7 +193,7 @@
gdm_log_init ();
- gdm_log_set_debug (TRUE);
+ gdm_log_set_debug (is_debug_set (debug));
if (display_id == NULL) {
g_critical ("No display ID set");
@@ -198,6 +213,7 @@
gdm_signal_handler_add (signal_handler, SIGSEGV, signal_cb, NULL);
gdm_signal_handler_add (signal_handler, SIGABRT, signal_cb, NULL);
gdm_signal_handler_add (signal_handler, SIGUSR1, signal_cb, NULL);
+ gdm_signal_handler_add (signal_handler, SIGUSR2, signal_cb, NULL);
slave = gdm_factory_slave_new (display_id);
if (slave == NULL) {
Modified: branches/gnome-2-22/daemon/product-slave-main.c
==============================================================================
--- branches/gnome-2-22/daemon/product-slave-main.c (original)
+++ branches/gnome-2-22/daemon/product-slave-main.c Tue May 6 18:16:08 2008
@@ -116,13 +116,19 @@
case SIGUSR1:
g_debug ("Got USR1 signal");
- /* FIXME:
- * Play with log levels or something
- */
+ /* we get this from xorg - can't use for anything else */
ret = TRUE;
break;
+ case SIGUSR2:
+ g_debug ("Got USR2 signal");
+ ret = TRUE;
+
+ gdm_log_toggle_debug ();
+
+ break;
+
default:
g_debug ("Caught unhandled signal %d", signo);
ret = TRUE;
@@ -142,6 +148,17 @@
g_main_loop_quit (main_loop);
}
+static gboolean
+is_debug_set (gboolean arg)
+{
+ /* enable debugging for unstable builds */
+ if (gdm_is_version_unstable ()) {
+ return TRUE;
+ }
+
+ return arg;
+}
+
int
main (int argc,
char **argv)
@@ -151,8 +168,10 @@
DBusGConnection *connection;
GdmSlave *slave;
static char *display_id = NULL;
+ static gboolean debug = FALSE;
GdmSignalHandler *signal_handler;
static GOptionEntry entries [] = {
+ { "debug", 0, 0, G_OPTION_ARG_NONE, &debug, N_("Enable debugging code"), NULL },
{ "display-id", 0, 0, G_OPTION_ARG_STRING, &display_id, N_("Display ID"), N_("id") },
{ NULL }
};
@@ -178,7 +197,7 @@
gdm_log_init ();
- gdm_log_set_debug (TRUE);
+ gdm_log_set_debug (is_debug_set (debug));
if (display_id == NULL) {
g_critical ("No display ID set");
@@ -198,6 +217,7 @@
gdm_signal_handler_add (signal_handler, SIGSEGV, signal_cb, NULL);
gdm_signal_handler_add (signal_handler, SIGABRT, signal_cb, NULL);
gdm_signal_handler_add (signal_handler, SIGUSR1, signal_cb, NULL);
+ gdm_signal_handler_add (signal_handler, SIGUSR2, signal_cb, NULL);
slave = gdm_product_slave_new (display_id);
if (slave == NULL) {
Modified: branches/gnome-2-22/daemon/session-worker-main.c
==============================================================================
--- branches/gnome-2-22/daemon/session-worker-main.c (original)
+++ branches/gnome-2-22/daemon/session-worker-main.c Tue May 6 18:16:08 2008
@@ -98,6 +98,8 @@
*/
ret = TRUE;
+ gdm_log_toggle_debug ();
+
break;
default:
@@ -110,6 +112,17 @@
return ret;
}
+static gboolean
+is_debug_set (gboolean arg)
+{
+ /* enable debugging for unstable builds */
+ if (gdm_is_version_unstable ()) {
+ return TRUE;
+ }
+
+ return arg;
+}
+
int
main (int argc,
char **argv)
@@ -119,7 +132,9 @@
GdmSessionWorker *worker;
GdmSignalHandler *signal_handler;
const char *address;
+ static gboolean debug = FALSE;
static GOptionEntry entries [] = {
+ { "debug", 0, 0, G_OPTION_ARG_NONE, &debug, N_("Enable debugging code"), NULL },
{ NULL }
};
@@ -138,7 +153,7 @@
g_option_context_free (context);
gdm_log_init ();
- gdm_log_set_debug (TRUE);
+ gdm_log_set_debug (is_debug_set (debug));
address = g_getenv ("GDM_SESSION_DBUS_ADDRESS");
if (address == NULL) {
Modified: branches/gnome-2-22/daemon/simple-slave-main.c
==============================================================================
--- branches/gnome-2-22/daemon/simple-slave-main.c (original)
+++ branches/gnome-2-22/daemon/simple-slave-main.c Tue May 6 18:16:08 2008
@@ -118,13 +118,19 @@
case SIGUSR1:
g_debug ("Got USR1 signal");
- /* FIXME:
- * Play with log levels or something
- */
+ /* we get this from xorg - can't use for anything else */
ret = TRUE;
break;
+ case SIGUSR2:
+ g_debug ("Got USR2 signal");
+ ret = TRUE;
+
+ gdm_log_toggle_debug ();
+
+ break;
+
default:
g_debug ("Caught unhandled signal %d", signo);
ret = TRUE;
@@ -144,6 +150,17 @@
g_main_loop_quit (main_loop);
}
+static gboolean
+is_debug_set (gboolean arg)
+{
+ /* enable debugging for unstable builds */
+ if (gdm_is_version_unstable ()) {
+ return TRUE;
+ }
+
+ return arg;
+}
+
int
main (int argc,
char **argv)
@@ -153,8 +170,10 @@
DBusGConnection *connection;
GdmSlave *slave;
static char *display_id = NULL;
+ static gboolean debug = FALSE;
GdmSignalHandler *signal_handler;
static GOptionEntry entries [] = {
+ { "debug", 0, 0, G_OPTION_ARG_NONE, &debug, N_("Enable debugging code"), NULL },
{ "display-id", 0, 0, G_OPTION_ARG_STRING, &display_id, N_("Display ID"), N_("id") },
{ NULL }
};
@@ -183,7 +202,7 @@
gdm_log_init ();
- gdm_log_set_debug (TRUE);
+ gdm_log_set_debug (is_debug_set (debug));
if (display_id == NULL) {
g_critical ("No display ID set");
@@ -208,6 +227,7 @@
gdm_signal_handler_add (signal_handler, SIGSEGV, signal_cb, NULL);
gdm_signal_handler_add (signal_handler, SIGABRT, signal_cb, NULL);
gdm_signal_handler_add (signal_handler, SIGUSR1, signal_cb, NULL);
+ gdm_signal_handler_add (signal_handler, SIGUSR2, signal_cb, NULL);
slave = gdm_simple_slave_new (display_id);
if (slave == NULL) {
Modified: branches/gnome-2-22/daemon/xdmcp-chooser-slave-main.c
==============================================================================
--- branches/gnome-2-22/daemon/xdmcp-chooser-slave-main.c (original)
+++ branches/gnome-2-22/daemon/xdmcp-chooser-slave-main.c Tue May 6 18:16:08 2008
@@ -116,11 +116,19 @@
case SIGUSR1:
g_debug ("Got USR1 signal");
- /* FIXME:
- * Play with log levels or something
- */
+ /* we get this from xorg - can't use for anything else */
ret = TRUE;
+ gdm_log_toggle_debug ();
+
+ break;
+
+ case SIGUSR2:
+ g_debug ("Got USR2 signal");
+ ret = TRUE;
+
+ gdm_log_toggle_debug ();
+
break;
default:
@@ -142,6 +150,17 @@
g_main_loop_quit (main_loop);
}
+static gboolean
+is_debug_set (gboolean arg)
+{
+ /* enable debugging for unstable builds */
+ if (gdm_is_version_unstable ()) {
+ return TRUE;
+ }
+
+ return arg;
+}
+
int
main (int argc,
char **argv)
@@ -151,8 +170,10 @@
DBusGConnection *connection;
GdmSlave *slave;
static char *display_id = NULL;
+ static gboolean debug = FALSE;
GdmSignalHandler *signal_handler;
static GOptionEntry entries [] = {
+ { "debug", 0, 0, G_OPTION_ARG_NONE, &debug, N_("Enable debugging code"), NULL },
{ "display-id", 0, 0, G_OPTION_ARG_STRING, &display_id, N_("Display ID"), N_("id") },
{ NULL }
};
@@ -178,7 +199,7 @@
gdm_log_init ();
- gdm_log_set_debug (TRUE);
+ gdm_log_set_debug (is_debug_set (debug));
if (display_id == NULL) {
g_critical ("No display ID set");
@@ -198,6 +219,7 @@
gdm_signal_handler_add (signal_handler, SIGSEGV, signal_cb, NULL);
gdm_signal_handler_add (signal_handler, SIGABRT, signal_cb, NULL);
gdm_signal_handler_add (signal_handler, SIGUSR1, signal_cb, NULL);
+ gdm_signal_handler_add (signal_handler, SIGUSR2, signal_cb, NULL);
slave = gdm_xdmcp_chooser_slave_new (display_id);
if (slave == NULL) {
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]