diff options
author | Alexander Larsson <alexl@redhat.com> | 2009-03-06 16:08:54 +0000 |
---|---|---|
committer | Alexander Larsson <alexl@src.gnome.org> | 2009-03-06 16:08:54 +0000 |
commit | 3574e9cdd559f88c3094366b91dc5fd06a6a776a (patch) | |
tree | d9012666d01d0aecb023fcfd409ca57f5397e797 | |
parent | 12ae6afc089127b8591c7f6f5a44340b7a3a326a (diff) | |
download | gvfs-3574e9cdd559f88c3094366b91dc5fd06a6a776a.tar.gz |
Only spew g_debug if backend started with --debug
2009-03-06 Alexander Larsson <alexl@redhat.com>
* ChangeLog:
* daemon/daemon-main.c:
Only spew g_debug if backend started with --debug
svn path=/trunk/; revision=2298
-rw-r--r-- | ChangeLog | 15 | ||||
-rw-r--r-- | daemon/daemon-main.c | 20 |
2 files changed, 35 insertions, 0 deletions
@@ -1,5 +1,20 @@ 2009-03-06 Alexander Larsson <alexl@redhat.com> + * ChangeLog: + * daemon/daemon-main.c: + Only spew g_debug if backend started with --debug + +2009-03-06 Alexander Larsson <alexl@redhat.com> + + Reviewed by NOBODY (OOPS!). + + * daemon/daemon-main.c: + (log_debug): + (daemon_init): + (daemon_parse_args): + +2009-03-06 Alexander Larsson <alexl@redhat.com> + * daemon/daemon-main.c: * daemon/gvfsbackend.c: * daemon/gvfsbackendburn.c: diff --git a/daemon/daemon-main.c b/daemon/daemon-main.c index ea37930f..c314911f 100644 --- a/daemon/daemon-main.c +++ b/daemon/daemon-main.c @@ -38,7 +38,17 @@ static char *spawner_id = NULL; static char *spawner_path = NULL; +static gboolean print_debug = FALSE; +static void +log_debug (const gchar *log_domain, + GLogLevelFlags log_level, + const gchar *message, + gpointer unused_data) +{ + if (print_debug) + g_print ("%s", message); +} void daemon_init (void) @@ -56,6 +66,9 @@ daemon_init (void) g_thread_init (NULL); g_type_init (); + g_log_set_handler (NULL, G_LOG_LEVEL_DEBUG, log_debug, NULL); + + dbus_error_init (&derror); connection = dbus_bus_get (DBUS_BUS_SESSION, &derror); if (connection == NULL) @@ -122,6 +135,13 @@ GMountSpec * daemon_parse_args (int argc, char *argv[], const char *default_type) { GMountSpec *mount_spec; + + if (argc > 1 && strcmp (argv[1], "--debug") == 0) + { + print_debug = TRUE; + argc--; + argv++; + } mount_spec = NULL; if (argc > 1 && strcmp (argv[1], "--spawner") == 0) |