summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog12
-rw-r--r--common/gdm-log.c5
-rw-r--r--daemon/factory-slave-main.c18
-rw-r--r--daemon/product-slave-main.c28
-rw-r--r--daemon/session-worker-main.c17
-rw-r--r--daemon/simple-slave-main.c28
-rw-r--r--daemon/xdmcp-chooser-slave-main.c30
7 files changed, 123 insertions, 15 deletions
diff --git a/ChangeLog b/ChangeLog
index 7aa0f617..28594544 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,17 @@
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 enable debugging.
+
+2008-05-06 William Jon McCann <jmccann@redhat.com>
+
* gui/simple-greeter/gdm-layouts.c (gdm_get_layout_from_name),
(gdm_get_all_layout_names), (gdm_layout_activate):
* gui/simple-greeter/gdm-layouts.h:
diff --git a/common/gdm-log.c b/common/gdm-log.c
index 29476b3f..e03d90e3 100644
--- a/common/gdm-log.c
+++ b/common/gdm-log.c
@@ -78,10 +78,11 @@ log_level_to_priority_and_prefix (GLogLevelFlags log_level,
* 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 @@ gdm_log_set_debug (gboolean debug)
{
if (debug) {
syslog_levels |= G_LOG_LEVEL_DEBUG;
+ g_debug ("Enabling debugging");
} else {
+ g_debug ("Disabling debugging");
syslog_levels &= ~G_LOG_LEVEL_DEBUG;
}
}
diff --git a/daemon/factory-slave-main.c b/daemon/factory-slave-main.c
index 986e568c..9bdc2129 100644
--- a/daemon/factory-slave-main.c
+++ b/daemon/factory-slave-main.c
@@ -121,6 +121,8 @@ signal_cb (int signo,
*/
ret = TRUE;
+ gdm_log_toggle_debug ();
+
break;
default:
@@ -142,6 +144,17 @@ on_slave_stopped (GdmSlave *slave,
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 @@ main (int argc,
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 @@ main (int argc,
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 @@ main (int argc,
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) {
diff --git a/daemon/product-slave-main.c b/daemon/product-slave-main.c
index b079587c..6282adf4 100644
--- a/daemon/product-slave-main.c
+++ b/daemon/product-slave-main.c
@@ -116,13 +116,19 @@ signal_cb (int signo,
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 @@ on_slave_stopped (GdmSlave *slave,
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 @@ main (int argc,
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 @@ main (int argc,
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 @@ main (int argc,
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) {
diff --git a/daemon/session-worker-main.c b/daemon/session-worker-main.c
index 666fd9c6..68669d57 100644
--- a/daemon/session-worker-main.c
+++ b/daemon/session-worker-main.c
@@ -98,6 +98,8 @@ signal_cb (int signo,
*/
ret = TRUE;
+ gdm_log_toggle_debug ();
+
break;
default:
@@ -110,6 +112,17 @@ signal_cb (int signo,
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 @@ main (int argc,
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 @@ main (int argc,
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) {
diff --git a/daemon/simple-slave-main.c b/daemon/simple-slave-main.c
index cf0e9a34..67e1bc33 100644
--- a/daemon/simple-slave-main.c
+++ b/daemon/simple-slave-main.c
@@ -118,13 +118,19 @@ signal_cb (int signo,
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 @@ on_slave_stopped (GdmSlave *slave,
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 @@ main (int argc,
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 @@ main (int argc,
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 @@ main (int argc,
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) {
diff --git a/daemon/xdmcp-chooser-slave-main.c b/daemon/xdmcp-chooser-slave-main.c
index 2f7996d1..29fdf227 100644
--- a/daemon/xdmcp-chooser-slave-main.c
+++ b/daemon/xdmcp-chooser-slave-main.c
@@ -116,11 +116,19 @@ signal_cb (int signo,
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 @@ on_slave_stopped (GdmSlave *slave,
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 @@ main (int argc,
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 @@ main (int argc,
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 @@ main (int argc,
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) {