summaryrefslogtreecommitdiff
path: root/telepathy-glib/debug.c
diff options
context:
space:
mode:
authorMikhail Zabaluev <mikhail.zabaluev@nokia.com>2007-07-23 12:26:35 +0000
committerMikhail Zabaluev <mikhail.zabaluev@nokia.com>2007-07-23 12:26:35 +0000
commit64cb00852f89adc02f9ff95ef4cea4c2dfc3a76b (patch)
tree71ea1b3887dec9db162054fe44b42884d33df8f6 /telepathy-glib/debug.c
parent0838e367eb24473753b04b3639e867f0041b1b5c (diff)
downloadtelepathy-glib-64cb00852f89adc02f9ff95ef4cea4c2dfc3a76b.tar.gz
Introduced the persistent mode API orthogonal to the debug flags
20070723122635-5b6ca-1a7269b72092345220146027e5fb539e56e81b5e.gz
Diffstat (limited to 'telepathy-glib/debug.c')
-rw-r--r--telepathy-glib/debug.c35
1 files changed, 34 insertions, 1 deletions
diff --git a/telepathy-glib/debug.c b/telepathy-glib/debug.c
index 1adfaf28d..41d48b6c3 100644
--- a/telepathy-glib/debug.c
+++ b/telepathy-glib/debug.c
@@ -73,6 +73,8 @@
static TpDebugFlags flags = 0;
+static gboolean tp_debug_persistent = FALSE;
+
/**
* tp_debug_set_all_flags:
*
@@ -88,7 +90,6 @@ static GDebugKey keys[] = {
{ "groups", TP_DEBUG_GROUPS },
{ "properties", TP_DEBUG_PROPERTIES },
{ "connection", TP_DEBUG_CONNECTION },
- { "persist", TP_DEBUG_PERSIST },
{ "im", TP_DEBUG_IM },
{ "params", TP_DEBUG_PARAMS },
{ "presence", TP_DEBUG_PRESENCE },
@@ -130,6 +131,21 @@ tp_debug_set_flags_from_env (const gchar *var)
tp_debug_set_flags_from_string (g_getenv (var));
}
+/**
+ * tp_debug_set_persistent:
+ * @persistent: TRUE prevents the connection manager mainloop from exiting,
+ * FALSE enables exiting if there are no connections
+ * (the default behavior).
+ *
+ * Used to enable persistent operation of the connection manager process for
+ * debugging purposes.
+ */
+void
+tp_debug_set_persistent (gboolean persistent)
+{
+ tp_debug_persistent = persistent;
+}
+
/*
* _tp_debug_set_flags:
* @new_flags More flags to set
@@ -175,6 +191,18 @@ void _tp_debug (TpDebugFlags flag,
}
}
+/*
+ * _tp_debug_is_persistent:
+ *
+ * Returns: %TRUE if persistent mainloop behavior has been enabled with
+ * tp_debug_set_persistent().
+ */
+gboolean
+_tp_debug_is_persistent (void)
+{
+ return tp_debug_persistent;
+}
+
#else /* !ENABLE_DEBUG */
void
@@ -192,4 +220,9 @@ tp_debug_set_flags_from_env (const gchar *var)
{
}
+void
+tp_debug_set_persistent (gboolean persistent)
+{
+}
+
#endif /* !ENABLE_DEBUG */