[PATCH 1/1] _dbus_set_verbose(): new function, which helps to reduce logging noice for test applications
Ralf Habacker
ralf.habacker at freenet.de
Tue Mar 9 13:06:27 PST 2010
---
dbus/dbus-internals.c | 11 +++++++++++
dbus/dbus-internals.h | 4 ++++
2 files changed, 15 insertions(+), 0 deletions(-)
diff --git a/dbus/dbus-internals.c b/dbus/dbus-internals.c
index a33d069..1f6fccd 100644
--- a/dbus/dbus-internals.c
+++ b/dbus/dbus-internals.c
@@ -383,6 +383,17 @@ _dbus_is_verbose_real (void)
}
/**
+ * Implementation of dbus_set_verbose() macro if built with verbose logging
+ * enabled.
+ * @param TRUE to enable verbose logging
+ */
+void _dbus_set_verbose_real (dbus_bool_t state)
+{
+ _dbus_verbose_init ();
+ verbose = state;
+}
+
+/**
* Prints a warning message to stderr
* if the user has enabled verbose mode.
* This is the real function implementation,
diff --git a/dbus/dbus-internals.h b/dbus/dbus-internals.h
index c87eb81..e5935f4 100644
--- a/dbus/dbus-internals.h
+++ b/dbus/dbus-internals.h
@@ -124,9 +124,12 @@ DBUS_EXPORT
void _dbus_verbose_reset_real (void);
DBUS_EXPORT
dbus_bool_t _dbus_is_verbose_real (void);
+DBUS_EXPORT
+void _dbus_set_verbose_real (dbus_bool_t state);
# define _dbus_verbose_reset _dbus_verbose_reset_real
# define _dbus_is_verbose _dbus_is_verbose_real
+# define _dbus_set_verbose(a) _dbus_set_verbose_real(a)
#else
# ifdef HAVE_ISO_VARARGS
# define _dbus_verbose(...)
@@ -137,6 +140,7 @@ static void _dbus_verbose(const char * x,...) {;}
# endif
# define _dbus_verbose_reset()
# define _dbus_is_verbose() FALSE
+# define _dbus_set_verbose(a)
#endif /* !DBUS_ENABLE_VERBOSE_MODE */
DBUS_EXPORT
--
1.6.4.msysgit.0
--------------010901020207080104060105--
More information about the dbus
mailing list