aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2010-01-16 23:44:16 +0100
committerMax Kellermann <max@duempel.org>2010-01-16 23:44:40 +0100
commit87c861cae3bc6ddd1db5bacf475c9f9854dd98c3 (patch)
tree7f8c9a892358047e2d048a8ce5cf761c170d3302
parent8f326a33eee8dc7eb5229774c013f07391bc5bde (diff)
downloadmpd-87c861cae3bc6ddd1db5bacf475c9f9854dd98c3.tar.gz
mpd-87c861cae3bc6ddd1db5bacf475c9f9854dd98c3.tar.xz
mpd-87c861cae3bc6ddd1db5bacf475c9f9854dd98c3.zip
test/run_convert: implement a GLib log callback
Log to stderr instead of the default stdout. We need a pristine stdout for the conversion result.
-rw-r--r--test/run_convert.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/test/run_convert.c b/test/run_convert.c
index 289e4baf6..ddfca0870 100644
--- a/test/run_convert.c
+++ b/test/run_convert.c
@@ -36,6 +36,16 @@
#include <stddef.h>
#include <unistd.h>
+static void
+my_log_func(const gchar *log_domain, G_GNUC_UNUSED GLogLevelFlags log_level,
+ const gchar *message, G_GNUC_UNUSED gpointer user_data)
+{
+ if (log_domain != NULL)
+ g_printerr("%s: %s\n", log_domain, message);
+ else
+ g_printerr("%s\n", message);
+}
+
const char *
config_get_string(G_GNUC_UNUSED const char *name, const char *default_value)
{
@@ -56,6 +66,8 @@ int main(int argc, char **argv)
return 1;
}
+ g_log_set_default_handler(my_log_func, NULL);
+
if (!audio_format_parse(&in_audio_format, argv[1],
false, &error)) {
g_printerr("Failed to parse audio format: %s\n",