glib/docs/reference
Simon McVittie 10b0ece9d8 gmessages: Add API to move info and debug messages to stderr
GLib code normally prints info and debug messages to stdout,
but that interferes with programs that are documented to produce
machine-readable output such as JSON or XML on stdout. In particular,
if such a program uses a GLib-based library, setting G_MESSAGES_DEBUG
will typically result in that library's debug messages going to the
program's stdout and corrupting the machine-readable output.

Unix programs can avoid this by using dup2() to move the original stdout
to another fd, then dup2() again to make the new stdout a copy of stderr,
but it's easier if we provide a way to not write debug messages to
stdout in the first place. Calling
g_log_writer_default_set_use_stderr (TRUE) results in behaviour
resembling Python's logging.basicConfig(), with all diagnostics going
to stderr.

Suggested by Allison Karlitskaya on glib#2087.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2020-10-07 14:03:50 +01:00
..
gio gio: Expose g_file_build_attribute_list_for_copy 2020-10-06 10:16:49 +01:00
glib gmessages: Add API to move info and debug messages to stderr 2020-10-07 14:03:50 +01:00
gobject Add boxing for GTree 2020-10-07 11:00:11 +01:00
.gitignore .gitignore manpages (*.1) 2010-05-24 23:21:01 -04:00
AUTHORS Initial revision 1999-08-16 17:58:30 +00:00
COPYING Initial revision 1999-08-16 17:58:30 +00:00
meson.build gversionmacros: Add version macros for GLib 2.68 2020-10-01 14:33:21 +01:00
NEWS Initial revision 1999-08-16 17:58:30 +00:00