Change g_log (and friends) to print to stderr. Fixes #10577.
authorRolf Bjarne Kvinge <rolf@xamarin.com>
Wed, 27 Feb 2013 21:53:58 +0000 (22:53 +0100)
committerRolf Bjarne Kvinge <rolf@xamarin.com>
Wed, 27 Feb 2013 22:06:40 +0000 (23:06 +0100)
Stdout is block buffered somewhere (and fflushing 'stdout' doesn't
fix it, only fflushing all streams works), and takes forever to
show up in any output.

eglib/src/goutput.c

index 69122ddda62b8fe188ccc3f6473e8d68a1a37683..c3dff59d891e981649c26de4bc17524b47cb8462 100644 (file)
@@ -147,8 +147,14 @@ g_logv (const gchar *log_domain, GLogLevelFlags log_level, const gchar *format,
        
        if (vasprintf (&msg, format, args) < 0)
                return;
+
+#if MONOTOUCH
+       FILE *target = stderr;
+#else
+       FILE *target = stdout;
+#endif
        
-       printf ("%s%s%s\n",
+       fprintf (target, "%s%s%s\n",
                log_domain != NULL ? log_domain : "",
                log_domain != NULL ? ": " : "",
                msg);