Use GLib logging system in nullclient

Tue, 19 Oct 2021 00:46:21 -0500

author
Elliott Sales de Andrade <quantum.analyst@gmail.com>
date
Tue, 19 Oct 2021 00:46:21 -0500
changeset 41121
85ddac53ef14
parent 41120
02abf3170610
child 41122
f29fa0dda4bf

Use GLib logging system in nullclient

Testing Done:
Compile only.

Reviewed at https://reviews.imfreedom.org/r/1075/

libpurple/example/nullclient.c file | annotate | diff | comparison | revisions
--- a/libpurple/example/nullclient.c	Tue Oct 19 00:41:44 2021 -0500
+++ b/libpurple/example/nullclient.c	Tue Oct 19 00:46:21 2021 -0500
@@ -36,6 +36,16 @@
 
 #include "defines.h"
 
+static GLogWriterOutput
+nullclient_g_log_handler(G_GNUC_UNUSED GLogLevelFlags log_level,
+                         G_GNUC_UNUSED const GLogField *fields,
+                         G_GNUC_UNUSED gsize n_fields,
+                         G_GNUC_UNUSED gpointer user_data)
+{
+	/* We do not want any debugging for now to keep the noise to a minimum. */
+	return G_LOG_WRITER_HANDLED;
+}
+
 /*** Conversation uiops ***/
 static void
 null_write_conv(PurpleConversation *conv, PurpleMessage *msg)
@@ -78,7 +88,7 @@
 	purple_util_set_user_dir(CUSTOM_USER_DIRECTORY);
 
 	/* We do not want any debugging for now to keep the noise to a minimum. */
-	purple_debug_set_enabled(FALSE);
+	g_log_set_writer_func(nullclient_g_log_handler, NULL, NULL);
 
 	/* Set the core-uiops, which is used to
 	 * 	- initialize the ui specific preferences.

mercurial