# HG changeset patch
# Node ID 147be77879c3
# Parent  fb359ee06e1a
diff --git a/libpurple/meson.build b/libpurple/meson.build
--- a/libpurple/meson.build
+++ b/libpurple/meson.build
@@ -294,7 +294,7 @@ libpurple = library('purple',
                     purple_coresources + purple_builtsources +
                     purple_builtheaders,
                     'purpleprivate.h',
-                    c_args : ['-DPURPLE_COMPILATION', '-DG_LOG_DOMAIN="Purple"'],
+                    c_args : ['-DPURPLE_COMPILATION', '-DG_LOG_USE_STRUCTURED', '-DG_LOG_DOMAIN="Purple"'],
                     include_directories : [toplevel_inc, libpurple_inc],
                     install : true,
                     version : PURPLE_LIB_VERSION,
diff --git a/libpurple/plugins/keyrings/kwallet/meson.build b/libpurple/plugins/keyrings/kwallet/meson.build
--- a/libpurple/plugins/keyrings/kwallet/meson.build
+++ b/libpurple/plugins/keyrings/kwallet/meson.build
@@ -11,6 +11,7 @@ if kwallet.found()
 	]
 
 	kwallet_plugin = library('purplekwallet', kwallet_sources,
+	    c_args : ['-DG_LOG_USE_STRUCTURED', '-DG_LOG_DOMAIN="Purple-KWalletKeyring"'],
 	    dependencies : [kwallet, qt5_dep, libpurple_dep],
 	    name_prefix : '',
 	    install : true, install_dir : PURPLE_PLUGINDIR)
diff --git a/libpurple/plugins/keyrings/meson.build b/libpurple/plugins/keyrings/meson.build
--- a/libpurple/plugins/keyrings/meson.build
+++ b/libpurple/plugins/keyrings/meson.build
@@ -2,6 +2,7 @@ subdir('kwallet')
 
 if nettle.found()
 	internalkeyring_plugin = library('internalkeyring', 'internalkeyring.c',
+	    c_args : ['-DG_LOG_USE_STRUCTURED', '-DG_LOG_DOMAIN="Purple-InternalKeyring"'],
 	    dependencies : [nettle, libpurple_dep],
 	    name_prefix : '',
 	    build_by_default : false,
@@ -10,6 +11,7 @@ endif
 
 if secretservice.found()
 	secretsservice_plugin = library('secretservice', 'secretservice.c',
+	    c_args : ['-DG_LOG_USE_STRUCTURED', '-DG_LOG_DOMAIN="Purple-SecretServiceKeyring"'],
 	    dependencies : [secretservice, libpurple_dep],
 	    name_prefix : '',
 	    install : true, install_dir : PURPLE_PLUGINDIR)
@@ -17,6 +19,7 @@ endif
 
 if IS_WIN32
 	wincred_plugin = library('wincred', 'wincred.c',
+	    c_args : ['-DG_LOG_USE_STRUCTURED', '-DG_LOG_DOMAIN="Purple-WinCredKeyring"'],
 	    dependencies : [libpurple_dep],
 	    name_prefix : '',
 	    install : true, install_dir : PURPLE_PLUGINDIR)
diff --git a/libpurple/plugins/meson.build b/libpurple/plugins/meson.build
--- a/libpurple/plugins/meson.build
+++ b/libpurple/plugins/meson.build
@@ -2,36 +2,43 @@ subdir('keyrings')
 subdir('notification-sound')
 
 autoaccept = library('autoaccept', 'autoaccept.c',
+    c_args : ['-DG_LOG_USE_STRUCTURED', '-DG_LOG_DOMAIN="PurplePlugin-AutoAccept"'],
     dependencies : [libpurple_dep, glib],
     name_prefix : '',
     install : true, install_dir : PURPLE_PLUGINDIR)
 
 buddynote = library('buddynote', 'buddynote.c',
+    c_args : ['-DG_LOG_USE_STRUCTURED', '-DG_LOG_DOMAIN="PurplePlugin-BuddyNote"'],
     dependencies : [libpurple_dep],
     name_prefix : '',
     install : true, install_dir : PURPLE_PLUGINDIR)
 
 idle = library('idle', 'idle.c',
+    c_args : ['-DG_LOG_USE_STRUCTURED', '-DG_LOG_DOMAIN="PurplePlugin-Idle"'],
     dependencies : [libpurple_dep],
     name_prefix : '',
     install : true, install_dir : PURPLE_PLUGINDIR)
 
 joinpart = library('joinpart', 'joinpart.c',
+    c_args : ['-DG_LOG_USE_STRUCTURED', '-DG_LOG_DOMAIN="PurplePlugin-JoinPart"'],
     dependencies : [libpurple_dep],
     name_prefix : '',
     install : true, install_dir : PURPLE_PLUGINDIR)
 
 psychic = library('psychic', 'psychic.c',
+    c_args : ['-DG_LOG_USE_STRUCTURED', '-DG_LOG_DOMAIN="PurplePlugin-Psychic"'],
     dependencies : [libpurple_dep],
     name_prefix : '',
     install : true, install_dir : PURPLE_PLUGINDIR)
 
 statenotify = library('statenotify', 'statenotify.c',
+    c_args : ['-DG_LOG_USE_STRUCTURED', '-DG_LOG_DOMAIN="PurplePlugin-StateNotify"'],
     dependencies : [libpurple_dep],
     name_prefix : '',
     install : true, install_dir : PURPLE_PLUGINDIR)
 
 purple_toast = library('purple-toast', 'purple-toast.c',
+	c_args : ['-DG_LOG_USE_STRUCTURED', '-DG_LOG_DOMAIN="PurplePlugin-Toast"'],
 	dependencies : [libpurple_dep],
 	name_prefix: '',
 	install : true, install_dir : PURPLE_PLUGINDIR)
diff --git a/libpurple/plugins/notification-sound/meson.build b/libpurple/plugins/notification-sound/meson.build
--- a/libpurple/plugins/notification-sound/meson.build
+++ b/libpurple/plugins/notification-sound/meson.build
@@ -2,6 +2,7 @@ if target_machine.system() != 'windows'
 	CANBERRA = dependency('libcanberra', version: '>= 0.30')
 
 	library('notification-sound', 'notification-sound.c',
+		c_args : ['-DG_LOG_USE_STRUCTURED', '-DG_LOG_DOMAIN="PurplePlugin-NotificationSound"'],
 		dependencies : [libpurple_dep, glib, CANBERRA],
 		name_prefix : '',
 		install : true, install_dir : PURPLE_PLUGINDIR)
diff --git a/libpurple/protocols/bonjour/meson.build b/libpurple/protocols/bonjour/meson.build
--- a/libpurple/protocols/bonjour/meson.build
+++ b/libpurple/protocols/bonjour/meson.build
@@ -33,6 +33,7 @@ if DYNAMIC_BONJOUR
 	BONJOUR_SOURCES += bonjour_resources
 
 	bonjour_prpl = shared_library('bonjour', BONJOUR_SOURCES,
+	    c_args : ['-DG_LOG_USE_STRUCTURED', '-DG_LOG_DOMAIN="Purple-Bonjour"'],
 	    link_args : bonjour_link_args,
 	    dependencies : [libxml, avahi, libpurple_dep, glib, nice, ws2_32],
 	    install : true, install_dir : PURPLE_PLUGINDIR)
diff --git a/libpurple/protocols/facebook/meson.build b/libpurple/protocols/facebook/meson.build
--- a/libpurple/protocols/facebook/meson.build
+++ b/libpurple/protocols/facebook/meson.build
@@ -26,6 +26,7 @@ if DYNAMIC_FACEBOOK
 	FACEBOOK_SOURCES += facebook_resources
 
 	facebook_prpl = shared_library('facebook', FACEBOOK_SOURCES,
+	    c_args : ['-DG_LOG_USE_STRUCTURED', '-DG_LOG_DOMAIN="Purple-Facebook"'],
 	    dependencies : [json, libpurple_dep, libsoup, glib],
 	    install : true, install_dir : PURPLE_PLUGINDIR)
 
diff --git a/libpurple/protocols/gg/meson.build b/libpurple/protocols/gg/meson.build
--- a/libpurple/protocols/gg/meson.build
+++ b/libpurple/protocols/gg/meson.build
@@ -57,6 +57,7 @@ if DYNAMIC_GG
 	GG_SOURCES += gg_resources
 
 	gg_prpl = shared_library('gg', GG_SOURCES,
+	    c_args : ['-DG_LOG_USE_STRUCTURED', '-DG_LOG_DOMAIN="Purple-GaduGadu"'],
 	    dependencies : [libgadu, json, libpurple_dep, libsoup, glib],
 	    install : true, install_dir : PURPLE_PLUGINDIR)
 
diff --git a/libpurple/protocols/irc/meson.build b/libpurple/protocols/irc/meson.build
--- a/libpurple/protocols/irc/meson.build
+++ b/libpurple/protocols/irc/meson.build
@@ -15,6 +15,7 @@ if DYNAMIC_IRC
 	IRC_SOURCES += irc_resources
 
 	irc_prpl = shared_library('irc', IRC_SOURCES,
+	    c_args : ['-DG_LOG_USE_STRUCTURED', '-DG_LOG_DOMAIN="Purple-IRC"'],
 	    dependencies : [sasl, libpurple_dep, glib, gio, ws2_32],
 	    install : true, install_dir : PURPLE_PLUGINDIR)
 
diff --git a/libpurple/protocols/jabber/meson.build b/libpurple/protocols/jabber/meson.build
--- a/libpurple/protocols/jabber/meson.build
+++ b/libpurple/protocols/jabber/meson.build
@@ -98,6 +98,7 @@ if DYNAMIC_JABBER
 	JABBER_SOURCES += xmpp_resources
 
 	jabber_prpl = shared_library('jabber', JABBER_SOURCES,
+	    c_args : ['-DG_LOG_USE_STRUCTURED', '-DG_LOG_DOMAIN="Purple-XMPP"'],
 	    link_args : jabber_link_args,
 	    dependencies : [gstreamer, idn, libxml, sasl, libpurple_dep, libsoup, glib, gio, math, nice, ws2_32],
 	    install : true, install_dir : PURPLE_PLUGINDIR)
diff --git a/libpurple/protocols/novell/meson.build b/libpurple/protocols/novell/meson.build
--- a/libpurple/protocols/novell/meson.build
+++ b/libpurple/protocols/novell/meson.build
@@ -31,6 +31,7 @@ if DYNAMIC_NOVELL
 	NOVELL_SOURCES += novell_resources
 
 	novell_prpl = shared_library('novell', NOVELL_SOURCES,
+	    c_args : ['-DG_LOG_USE_STRUCTURED', '-DG_LOG_DOMAIN="Purple-Novell"'],
 	    dependencies : [libpurple_dep, glib, ws2_32],
 	    install : true, install_dir : PURPLE_PLUGINDIR)
 
diff --git a/libpurple/protocols/null/meson.build b/libpurple/protocols/null/meson.build
--- a/libpurple/protocols/null/meson.build
+++ b/libpurple/protocols/null/meson.build
@@ -6,6 +6,7 @@ NULL_SOURCES = [
 # nullprpl isn't built by default; when it is built, it's dynamically linked
 if DYNAMIC_NULL
 	null_prpl = shared_library('null', NULL_SOURCES,
+	    c_args : ['-DG_LOG_USE_STRUCTURED', '-DG_LOG_DOMAIN="Purple-Null"'],
 	    dependencies : [libpurple_dep, glib],
 	    install : false, install_dir : PURPLE_PLUGINDIR)
 
diff --git a/libpurple/protocols/sametime/meson.build b/libpurple/protocols/sametime/meson.build
--- a/libpurple/protocols/sametime/meson.build
+++ b/libpurple/protocols/sametime/meson.build
@@ -13,7 +13,7 @@ if DYNAMIC_SAMETIME
 	SAMETIME_SOURCES += sametime_resources
 
 	sametime_prpl = shared_library('sametime', SAMETIME_SOURCES,
-	    c_args : ['-DG_LOG_DOMAIN="sametime"'],
+	    c_args : ['-DG_LOG_USE_STRUCTURED', '-DG_LOG_DOMAIN="Purple-Sametime"'],
 	    dependencies : [meanwhile, gmime, libpurple_dep, glib],
 	    install : true, install_dir : PURPLE_PLUGINDIR)
 
diff --git a/libpurple/protocols/silc/meson.build b/libpurple/protocols/silc/meson.build
--- a/libpurple/protocols/silc/meson.build
+++ b/libpurple/protocols/silc/meson.build
@@ -20,6 +20,7 @@ if DYNAMIC_SILC
 	SILC_SOURCES += silc_resources
 
 	silc_prpl = shared_library('silcpurple', SILC_SOURCES,
+	    c_args : ['-DG_LOG_USE_STRUCTURED', '-DG_LOG_DOMAIN="Purple-SILC"'],
 	    dependencies : [silc, libpurple_dep, glib],
 	    install : true, install_dir : PURPLE_PLUGINDIR)
 
diff --git a/libpurple/protocols/zephyr/meson.build b/libpurple/protocols/zephyr/meson.build
--- a/libpurple/protocols/zephyr/meson.build
+++ b/libpurple/protocols/zephyr/meson.build
@@ -77,7 +77,7 @@ if DYNAMIC_ZEPHYR
 	ZEPHYR_SOURCES += zephyr_resources
 
 	zephyr_prpl = shared_library('zephyr', ZEPHYR_SOURCES,
-	    c_args : '-Dlint',
+	    c_args : ['-Dlint', '-DG_LOG_USE_STRUCTURED', '-DG_LOG_DOMAIN="Purple-Zephyr"'],
 	    dependencies : [extdep, libpurple_dep, glib],
 	    install : true, install_dir : PURPLE_PLUGINDIR)
 
diff --git a/libpurple/tests/meson.build b/libpurple/tests/meson.build
--- a/libpurple/tests/meson.build
+++ b/libpurple/tests/meson.build
@@ -24,7 +24,9 @@ test_ui = static_library(
     'test_ui.c',
     'test_ui.h',
     c_args: [
-        '-DTEST_DATA_DIR="@0@/data"'.format(meson.current_source_dir())
+        '-DTEST_DATA_DIR="@0@/data"'.format(meson.current_source_dir()),
+        '-DG_LOG_USE_STRUCTURED',
+        '-DG_LOG_DOMAIN="Purple-TestUI"',
     ],
     dependencies: [libpurple_dep, glib]
 )
