summaryrefslogtreecommitdiff
path: root/tumbler
diff options
context:
space:
mode:
authorGaël Bonithon <gael@xfce.org>2021-12-25 18:48:43 +0100
committerGaël Bonithon <gael@xfce.org>2021-12-26 18:30:03 +0100
commitef518751bd744a48a165dc7c285f98b960c64a75 (patch)
tree8a1261a63af9bea6532e9610c61320ab2d3571a7 /tumbler
parent2c1fc2a84b7d7dcc731070f908b82da680972935 (diff)
downloadtumbler-ef518751bd744a48a165dc7c285f98b960c64a75.tar.gz
Debug: Add or adjust some traces and dumps
Diffstat (limited to 'tumbler')
-rw-r--r--tumbler/tumbler-util.c26
-rw-r--r--tumbler/tumbler-util.h4
2 files changed, 30 insertions, 0 deletions
diff --git a/tumbler/tumbler-util.c b/tumbler/tumbler-util.c
index c7be630..04c434d 100644
--- a/tumbler/tumbler-util.c
+++ b/tumbler/tumbler-util.c
@@ -59,6 +59,32 @@ tumbler_util_is_debug_logging_enabled (const gchar *log_domain)
+void
+tumbler_util_dump_strv (const gchar *log_domain,
+ const gchar *label,
+ const gchar *const *strv)
+{
+ GString *string;
+ const gchar *const *p;
+
+ g_return_if_fail (label != NULL && strv != NULL);
+
+ if (! tumbler_util_is_debug_logging_enabled (log_domain))
+ return;
+
+ string = g_string_new (label);
+ g_string_append (string, ":\n");
+
+ for (p = strv; *p != NULL; p++)
+ g_string_append_printf (string, " %s\n", *p);
+
+ g_string_truncate (string, string->len - 1);
+ g_log (log_domain, G_LOG_LEVEL_DEBUG, "%s", string->str);
+ g_string_free (string, TRUE);
+}
+
+
+
gchar **
tumbler_util_get_supported_uri_schemes (void)
{
diff --git a/tumbler/tumbler-util.h b/tumbler/tumbler-util.h
index 037bcf3..20a0cc3 100644
--- a/tumbler/tumbler-util.h
+++ b/tumbler/tumbler-util.h
@@ -30,6 +30,10 @@ G_BEGIN_DECLS
gboolean tumbler_util_is_debug_logging_enabled (const gchar *log_domain);
+void tumbler_util_dump_strv (const gchar *log_domain,
+ const gchar *label,
+ const gchar *const *strv);
+
gchar **tumbler_util_get_supported_uri_schemes (void) G_GNUC_MALLOC;
GKeyFile *tumbler_util_get_settings (void) G_GNUC_MALLOC;