/soc/2012/michael/android: 4c1265e16d6c: Made logging use the g_...

Michael Zangl michael at soc.pidgin.im
Wed Jul 25 07:23:38 EDT 2012


Changeset: 4c1265e16d6c3eb6ea930b76c8d10f187485fd28
Author:	 Michael Zangl <michael at soc.pidgin.im>
Date:	 2012-07-21 11:22 +0200
Branch:	 soc.2012.android
URL: http://hg.pidgin.im/soc/2012/michael/android/rev/4c1265e16d6c

Description:

Made logging use the g_log function.

diffstat:

 android/workspace/im.pidgin.libpurple/native/CoreManager.c   |  1 +
 android/workspace/im.pidgin.libpurple/native/PurpleAccount.c |  3 +++
 android/workspace/im.pidgin.libpurple/native/logging.c       |  4 +++-
 3 files changed, 7 insertions(+), 1 deletions(-)

diffs (52 lines):

diff --git a/android/workspace/im.pidgin.libpurple/native/CoreManager.c b/android/workspace/im.pidgin.libpurple/native/CoreManager.c
--- a/android/workspace/im.pidgin.libpurple/native/CoreManager.c
+++ b/android/workspace/im.pidgin.libpurple/native/CoreManager.c
@@ -53,6 +53,7 @@ Java_im_pidgin_libpurple_core_CoreManage
 	jboolean success;
 	const char* user_dir_native;
 	const char* ui_name_native;
+	initLogging();
 
 	setJavaObject(&coreManagerInstance, env, obj);
 
diff --git a/android/workspace/im.pidgin.libpurple/native/PurpleAccount.c b/android/workspace/im.pidgin.libpurple/native/PurpleAccount.c
--- a/android/workspace/im.pidgin.libpurple/native/PurpleAccount.c
+++ b/android/workspace/im.pidgin.libpurple/native/PurpleAccount.c
@@ -166,6 +166,8 @@ Java_im_pidgin_libpurple_account_PurpleA
 	const char *alias_native;
 	PurpleBuddy *buddy;
 
+	g_log("jni", G_LOG_LEVEL_DEBUG, "bl: %p, root: %p", purple_get_blist(), purple_blist_get_root());
+
 	name_native = (*env)->GetStringUTFChars(env, name, NULL);
 	g_return_val_if_fail(name_native != NULL, 0);
 
@@ -186,6 +188,7 @@ Java_im_pidgin_libpurple_account_PurpleA
 	g_return_val_if_fail(buddy != NULL, 0);
 
 	purple_account_add_buddy(account_native, buddy, NULL);
+	purple_blist_add_buddy(buddy, NULL, NULL, NULL);
 
 	return pToLong(buddy);
 }
diff --git a/android/workspace/im.pidgin.libpurple/native/logging.c b/android/workspace/im.pidgin.libpurple/native/logging.c
--- a/android/workspace/im.pidgin.libpurple/native/logging.c
+++ b/android/workspace/im.pidgin.libpurple/native/logging.c
@@ -16,7 +16,7 @@ gboolean debugEnabled;
 static void
 debugPrint(PurpleDebugLevel level, const char *category, const char *arg_s)
 {
-	g_log(category, G_LOG_LEVEL_DEBUG, "%s", arg_s);
+	g_log("purple", G_LOG_LEVEL_DEBUG, "%s: %s", category, arg_s);
 }
 
 #ifndef X86
@@ -81,6 +81,8 @@ initLogging()
 #ifdef USE_GSTREAMER
 	REGISTER_G_LOG_HANDLER("GStreamer");
 #endif
+	REGISTER_G_LOG_HANDLER("purple");
+	REGISTER_G_LOG_HANDLER("jni");
 #endif
 
 	purple_debug_set_ui_ops(&debugUiOps);



More information about the Commits mailing list