diff options
author | Havoc Pennington <hp@redhat.com> | 2001-05-11 14:57:44 +0000 |
---|---|---|
committer | Havoc Pennington <hp@src.gnome.org> | 2001-05-11 14:57:44 +0000 |
commit | 008857b35d310df250d1016fc9c72f65b1dbb23a (patch) | |
tree | f29a8ef74147f26156ad6cf993db66f60a787872 | |
parent | e5bd4077d2d862edb810029cc09b83e90efae542 (diff) | |
download | gconf-008857b35d310df250d1016fc9c72f65b1dbb23a.tar.gz |
Merge from stable.
2001-05-11 Havoc Pennington <hp@redhat.com>
Merge from stable.
* gconf/gconfd.c (signal_handler): on SIGUSR1, enable/disable
debug spew.
* gconf/gconf-internals.c (gconf_log): use a runtime variable to
decide whether to log debug messages
* gconf/gconf-database.c, gconf/gconfd.c, gconf/gconf-internals.c:
Change some GCL_WARNING to GCL_DEBUG to chill out logging of
fairly normal events
-rw-r--r-- | ChangeLog | 14 | ||||
-rw-r--r-- | gconf/gconf-database.c | 6 | ||||
-rw-r--r-- | gconf/gconf-internals.c | 7 | ||||
-rw-r--r-- | gconf/gconf-internals.h | 2 | ||||
-rw-r--r-- | gconf/gconfd.c | 7 |
5 files changed, 29 insertions, 7 deletions
@@ -1,3 +1,17 @@ +2001-05-11 Havoc Pennington <hp@redhat.com> + + Merge from stable. + + * gconf/gconfd.c (signal_handler): on SIGUSR1, enable/disable + debug spew. + + * gconf/gconf-internals.c (gconf_log): use a runtime variable to + decide whether to log debug messages + + * gconf/gconf-database.c, gconf/gconfd.c, gconf/gconf-internals.c: + Change some GCL_WARNING to GCL_DEBUG to chill out logging of + fairly normal events + 2001-05-09 Havoc Pennington <hp@redhat.com> * gconf/Makefile.am: remove testgconfclient from build, should diff --git a/gconf/gconf-database.c b/gconf/gconf-database.c index 9d8b67a3..61454917 100644 --- a/gconf/gconf-database.c +++ b/gconf/gconf-database.c @@ -514,7 +514,7 @@ impl_ConfigDatabase_clear_cache(PortableServer_Servant servant, if (gconfd_check_in_shutdown (ev)) return; - gconf_log(GCL_INFO, _("Received request to drop all cached data")); + gconf_log(GCL_DEBUG, _("Received request to drop all cached data")); gconf_database_clear_cache(db, &error); @@ -531,7 +531,7 @@ impl_ConfigDatabase_synchronous_sync(PortableServer_Servant servant, if (gconfd_check_in_shutdown (ev)) return; - gconf_log(GCL_INFO, _("Received request to sync synchronously")); + gconf_log(GCL_DEBUG, _("Received request to sync synchronously")); gconf_database_synchronous_sync(db, &error); @@ -920,7 +920,7 @@ notify_listeners_cb(GConfListeners* listeners, if(closure->ev._major != CORBA_NO_EXCEPTION) { - gconf_log(GCL_WARNING, "Failed to notify listener %u, removing: %s", + gconf_log(GCL_DEBUG, "Failed to notify listener %u, removing: %s", cnxn_id, CORBA_exception_id(&closure->ev)); CORBA_exception_free(&closure->ev); diff --git a/gconf/gconf-internals.c b/gconf/gconf-internals.c index 72d43ded..4ef2610c 100644 --- a/gconf/gconf-internals.c +++ b/gconf/gconf-internals.c @@ -37,6 +37,8 @@ #include <time.h> #include <math.h> +gboolean gconf_log_debug_messages = FALSE; + static gboolean gconf_daemon_mode = FALSE; static gchar* daemon_ior = NULL; @@ -1055,10 +1057,9 @@ gconf_log(GConfLogPriority pri, const gchar* fmt, ...) va_list args; int syslog_pri = LOG_DEBUG; -#ifndef GCONF_ENABLE_DEBUG - if (pri == GCL_DEBUG) + if (!gconf_log_debug_messages && + pri == GCL_DEBUG) return; -#endif va_start (args, fmt); msg = g_strdup_vprintf(fmt, args); diff --git a/gconf/gconf-internals.h b/gconf/gconf-internals.h index d898c891..23889229 100644 --- a/gconf/gconf-internals.h +++ b/gconf/gconf-internals.h @@ -95,6 +95,8 @@ typedef enum { void gconf_log (GConfLogPriority pri, const gchar* format, ...) G_GNUC_PRINTF (2, 3); +extern gboolean gconf_log_debug_messages; + /* return FALSE and set error if the key is bad */ gboolean gconf_key_check(const gchar* key, GError** err); diff --git a/gconf/gconfd.c b/gconf/gconfd.c index 23db7555..616eb82a 100644 --- a/gconf/gconfd.c +++ b/gconf/gconfd.c @@ -243,7 +243,7 @@ gconfd_shutdown(PortableServer_Servant servant, CORBA_Environment *ev) if (gconfd_check_in_shutdown (ev)) return; - gconf_log(GCL_INFO, _("Shutdown request received")); + gconf_log(GCL_DEBUG, _("Shutdown request received")); gconf_main_quit(); } @@ -403,6 +403,11 @@ signal_handler (int signo) if (gconf_main_is_running ()) gconf_main_quit (); break; + + case SIGUSR1: + /* it'd be nice to log a message here but it's not very safe, so */ + gconf_log_debug_messages = !gconf_log_debug_messages; + break; default: break; |