Allow using g_log_structured instead of g_log
commit0d0ba82cecfdae5e006ee8c205abd2f4a9bf34ea
authorMatthias Clasen <mclasen@redhat.com>
Mon, 18 Jul 2016 03:22:31 +0000 (17 23:22 -0400)
committerMatthias Clasen <mclasen@redhat.com>
Thu, 21 Jul 2016 00:42:09 +0000 (20 20:42 -0400)
tree41aed838ad5fcd063a66e529c7a822bc1e70e246
parentdb0bf5bbf174c80f84320d315c94282de592cbea
Allow using g_log_structured instead of g_log

Look for a macro G_LOG_USE_STRUCTURED, and if it is defined, use
g_log_structured instead of g_log when defining g_warning and friends.
This avoids the extra complication of going through g_logv _and_
g_log_structured to get a message logged; it also lets us pass
the code-related fields.

We don't do this unconditionally (yet), since some users might
rely on the more fine-grained fatality support in g_logv. It has
also been proven problematic in the past to inject a dependency
on bleeding-edge API via a widely-used macro.

https://bugzilla.gnome.org/show_bug.cgi?id=744456
glib/gmessages.h