Author: dzzinstant Date: Mon Jun 9 02:08:32 2014 New Revision: 18 URL: http://svn.gna.org/viewcvs/pidgin-zrtp?rev=18&view=rev Log: unified debug msgs
Modified: trunk/src/pidgin-plugin/simplezrtp/encrypt-backend-zrtp.c trunk/src/pidgin-plugin/simplezrtp/encrypt.c trunk/src/pidgin-plugin/simplezrtp/gtk-encrypt.c Modified: trunk/src/pidgin-plugin/simplezrtp/encrypt-backend-zrtp.c URL: http://svn.gna.org/viewcvs/pidgin-zrtp/trunk/src/pidgin-plugin/simplezrtp/encrypt-backend-zrtp.c?rev=18&r1=17&r2=18&view=diff ============================================================================== --- trunk/src/pidgin-plugin/simplezrtp/encrypt-backend-zrtp.c (original) +++ trunk/src/pidgin-plugin/simplezrtp/encrypt-backend-zrtp.c Mon Jun 9 02:08:32 2014 @@ -138,7 +138,7 @@ while (GST_ITERATOR_OK == gst_iterator_next(iter, &el)) { gchar *elname = gst_element_get_name(GST_ELEMENT(el)); - purple_debug_info(PLUGIN_ID, "backend: element %s (%p)\n", elname, el); + purple_debug_info(PLUGIN_ID " backend", "element %s (%p)\n", elname, el); if (1 == sscanf(elname, "conf_%p", ptr)) { /* sscanf() gets the FsRtpConference object address @@ -276,7 +276,7 @@ PurpleEncryptBackendZrtpPrivate *priv = PURPLE_ENCRYPT_BACKEND_ZRTP_GET_PRIVATE(obj); - purple_debug_info("encrypt-backend-zrtp", "purple_encrypt_backend_zrtp_dispose\n"); + purple_debug_info(PLUGIN_ID " backend", "purple_encrypt_backend_zrtp_dispose\n"); teardown_zrtpconference(PURPLE_ENCRYPT_BACKEND_ZRTP(obj)); @@ -322,7 +322,7 @@ g_object_add_weak_pointer(G_OBJECT(priv->media), (gpointer*)&priv->media); - purple_debug_info(PLUGIN_ID, "PurpleEncryptBackend, set 'media' = %p\n", priv->media); + purple_debug_info(PLUGIN_ID " backend", "set 'media' = %p\n", priv->media); g_signal_connect(G_OBJECT(get_backend_fs2(self, priv->media)), "candidates-prepared", @@ -456,7 +456,7 @@ GstElement *fsconf = get_fsconference(self); GObject *zrtpconf = NULL; - purple_debug_info(PLUGIN_ID, "backend: setup_conference(backend=%p): fsconf %p\n", + purple_debug_info(PLUGIN_ID " backend", "setup_conference(backend=%p): fsconf %p\n", self, fsconf); if (!G_IS_OBJECT(fsconf)) return NULL; @@ -465,17 +465,17 @@ if (g_object_class_find_property(G_OBJECT_GET_CLASS(fsconf), "zrtp-conference")) { g_object_get(G_OBJECT(fsconf), "zrtp-conference", &zrtpconf, NULL); - purple_debug_info(PLUGIN_ID, "backend: fsconf (%p) has property zrtp-conference: zrtpconf %p\n", + purple_debug_info(PLUGIN_ID " backend", "fsconf (%p) has property zrtp-conference: zrtpconf %p\n", fsconf, zrtpconf); } else { // TODO: Add an application-driven mode that keeps zrtp-conferences in a local storage (e.g. hashtable) instead // zrtpconf = G_OBJECT(zrtp_conference_find((gpointer) fsconf)); -// purple_debug_info(PLUGIN_ID, "backend: found zrtpconf=%p by index fsconf=%p\n", +// purple_debug_info(PLUGIN_ID " backend", "found zrtpconf=%p by index fsconf=%p\n", // zrtpconf, fsconf); } if (!zrtpconf) { - purple_debug_warning(PLUGIN_ID, "backend: fsconf (%p): no property zrtp-conference!\n", + purple_debug_warning(PLUGIN_ID " backend", "fsconf (%p): no property zrtp-conference!\n", fsconf); return NULL; } @@ -552,7 +552,7 @@ candidates_prepared_cb(PurpleMediaBackendFs2 *backend, const gchar *sess_id, const gchar *name, PurpleEncryptBackendZrtp *self) { - purple_debug_info(PLUGIN_ID, + purple_debug_info(PLUGIN_ID " backend", "'candidates-prepared' (sess_id=%s name=%s self=%p backend=%p): no-op\n", sess_id, name, self, backend); } @@ -561,7 +561,7 @@ state_changed_cb(PurpleMedia *media, PurpleMediaState state, gchar *sid, gchar *name, PurpleEncryptBackendZrtp *self) { - purple_debug_info(PLUGIN_ID, + purple_debug_info(PLUGIN_ID " backend", "'state-changed' (state #%d sid=%s name=%s self=%p media=%p)\n", state, sid, name, self, media); @@ -574,8 +574,8 @@ gchar *confname = gst_element_get_name(conf); gchar *fsname = gst_element_get_name(fsconf); - purple_debug_info(PLUGIN_ID, - "backend: 'state-changed' conference %s (%p), fsconf %s (%p)\n", + purple_debug_info(PLUGIN_ID " backend", + "'state-changed' conference %s (%p), fsconf %s (%p)\n", confname, conf, fsname, fsconf); g_free(fsname); @@ -597,7 +597,7 @@ gchar *sid, gchar *name, gboolean is_local, PurpleEncryptBackendZrtp *self) { - purple_debug_info(PLUGIN_ID, + purple_debug_info(PLUGIN_ID " backend", "'stream-info' (state #%d sid=%s name=%s self=%p media=%p %s): no-op\n", state, sid, name, self, media, is_local ? "local":"remote"); } @@ -613,7 +613,7 @@ PURPLE_ENCRYPT_BACKEND_ZRTP_GET_PRIVATE(self); gchar *participant; - purple_debug_info(PLUGIN_ID, + purple_debug_info(PLUGIN_ID " backend", "'new-zrtpcall' (zrtpcall=%p self=%p zrtpconf=%p)\n", zrtpcall, self, zrtpconf); @@ -627,7 +627,7 @@ { gchar *participant; - purple_debug_info(PLUGIN_ID, + purple_debug_info(PLUGIN_ID " backend", "'new-zrtpmaster' (zrtpcall=%p self=%p zrtpconf=%p)\n", zrtpcall, self, zrtpconf); @@ -639,7 +639,7 @@ new_zrtpfilter_cb(GObject *zrtpconf, gchar *name, PurpleEncryptBackendZrtp *self) { - purple_debug_info(PLUGIN_ID, + purple_debug_info(PLUGIN_ID " backend", "'new-zrtpfilter' (name=%s self=%p zrtpconf=%p): no-op\n", name, self, zrtpconf); } @@ -654,7 +654,7 @@ { PurpleEncryptState flags = PURPLE_ENCRYPT_STATE_ENC; - purple_debug_info(PLUGIN_ID, "_set_enc_state(mode=%s): flags=0x%04x.\n", + purple_debug_info(PLUGIN_ID " backend", "_set_enc_state(mode=%s): flags=0x%04x.\n", (onoff) ? "ENC":"NOENC", flags); flags |= (onoff) ? PURPLE_ENCRYPT_STATE_SET:PURPLE_ENCRYPT_STATE_CLEAR; @@ -668,7 +668,7 @@ { PurpleEncryptState flags = PURPLE_ENCRYPT_STATE_AUTH; - purple_debug_info(PLUGIN_ID, "_set_auth_state(mode=%s): flags=0x%04x.\n", + purple_debug_info(PLUGIN_ID " backend", "_set_auth_state(mode=%s): flags=0x%04x.\n", (onoff) ? "AUTH":"NOAUTH", flags); flags |= (onoff) ? PURPLE_ENCRYPT_STATE_SET:PURPLE_ENCRYPT_STATE_CLEAR;; @@ -733,7 +733,7 @@ const gchar *zrtpmsg, *desc, *submsg, *subdesc; zrtpmsg = get_zrtpmsg(severity, subCode, &desc, &submsg, &subdesc); - purple_debug_info(PLUGIN_ID, "ZRTP %s (subCode=%u): %s (%s): %s\n", + purple_debug_info(PLUGIN_ID " backend", "ZRTP %s (subCode=%u): %s (%s): %s\n", zrtpmsg, subCode, submsg, subdesc, namestr); switch (zrtpmsg[0]) { @@ -759,7 +759,7 @@ zrtp_sas (GstElement *element, gchar* sas, gint verified, ZrtpContext *data) { PurpleEncryptBackendZrtp *self = PURPLE_ENCRYPT_BACKEND_ZRTP(data->backend); - purple_debug_info(PLUGIN_ID, "SAS code: %s, verified status: %d\n", sas, verified); + purple_debug_info(PLUGIN_ID " backend", "SAS code: %s, verified status: %d\n", sas, verified); g_signal_emit_by_name(self, "authstring", sas); g_signal_emit_by_name(self, "authstring-verified", verified); @@ -768,7 +768,7 @@ static void zrtp_algorithm(GstElement *element, gchar* algorithms, ZrtpContext *data) { gchar *str = g_strdup(algorithms); - purple_debug_info(PLUGIN_ID, "Negotiated algorithms: %s\n", str); + purple_debug_info(PLUGIN_ID " backend", "Negotiated algorithms: %s\n", str); g_free(str); } @@ -779,7 +779,8 @@ const gchar *submsg, *desc; get_zrtpmsg(severity, subCode, NULL, &submsg, &desc); - purple_debug_warning(PLUGIN_ID, "ZRTP status severe message: %s - %s (subcode %d)\n", submsg, desc, subCode); + purple_debug_warning(PLUGIN_ID " backend", + "ZRTP status severe message: %s - %s (subcode %d)\n", submsg, desc, subCode); set_enc_state(self, FALSE); // g_signal_emit_by_name(G_OBJECT(self), Modified: trunk/src/pidgin-plugin/simplezrtp/encrypt.c URL: http://svn.gna.org/viewcvs/pidgin-zrtp/trunk/src/pidgin-plugin/simplezrtp/encrypt.c?rev=18&r1=17&r2=18&view=diff ============================================================================== --- trunk/src/pidgin-plugin/simplezrtp/encrypt.c (original) +++ trunk/src/pidgin-plugin/simplezrtp/encrypt.c Mon Jun 9 02:08:32 2014 @@ -380,9 +380,6 @@ g_return_val_if_fail(PURPLE_IS_ENCRYPT(self), NULL); priv = PURPLE_ENCRYPT_GET_PRIVATE(self); - - purple_debug_info("PurpleEncrypt [zrtp]", "get_ui_data(encrypt=%p): ui_data=%p.\n", - self, priv->ui_data); return priv->ui_data; } @@ -392,9 +389,6 @@ g_return_if_fail(PURPLE_IS_ENCRYPT(self)); priv = PURPLE_ENCRYPT_GET_PRIVATE(self); - - purple_debug_info("PurpleEncrypt [zrtp]", "set_ui_data(encrypt=%p, ui_data=%p).\n", - self, ui_data); priv->ui_data = ui_data; } @@ -409,9 +403,8 @@ PurpleEncryptUiOps *ui_ops = purple_encrypt_get_ui_ops(); purple_debug_info(PLUGIN_ID, - "(media=%p encrypt=%p) \"state-changed\": " - "state %d for (sess_id=%s name=%s).\n", - media, self, state, sess_id, name); + "'state-changed' (state #%d sid=%s name=%s self=%p media=%p)\n", + state, sess_id, name, self, media); if (sess_id == NULL && name == NULL) { /* change of the conference */ switch (state) { @@ -451,9 +444,8 @@ PurpleEncrypt *self) { purple_debug_info(PLUGIN_ID, - "(media=%p, encrypt=%p) \"stream-info\": " - "type %d for (sess_id=%s, name=%s, %s).\n", - media, self, type, sess_id, name, is_local ? "isLocal":"isRemote"); + "'stream-info' (type #%d sid=%s name=%s self=%p media=%p %s): no-op\n", + type, sess_id, name, self, media, is_local ? "local":"remote"); } static void Modified: trunk/src/pidgin-plugin/simplezrtp/gtk-encrypt.c URL: http://svn.gna.org/viewcvs/pidgin-zrtp/trunk/src/pidgin-plugin/simplezrtp/gtk-encrypt.c?rev=18&r1=17&r2=18&view=diff ============================================================================== --- trunk/src/pidgin-plugin/simplezrtp/gtk-encrypt.c (original) +++ trunk/src/pidgin-plugin/simplezrtp/gtk-encrypt.c Mon Jun 9 02:08:32 2014 @@ -171,7 +171,7 @@ PidginEncryptPrivate *priv = PIDGIN_ENCRYPT_GET_PRIVATE(self); g_return_if_fail(PIDGIN_IS_ENCRYPT(obj)); - purple_debug_info(PLUGIN_ID, "pidgin_encrypt_dispose\n"); + purple_debug_info(PLUGIN_ID "UI", "pidgin_encrypt_dispose\n"); if (priv->encrypt) { purple_encrypt_set_ui_data(priv->encrypt, NULL); g_object_unref(priv->encrypt); @@ -202,7 +202,7 @@ static void pidgin_encrypt_finalize(GObject *obj) { - purple_debug_info(PLUGIN_ID, "pidgin_encrypt_finalize\n"); + purple_debug_info(PLUGIN_ID " UI", "pidgin_encrypt_finalize\n"); G_OBJECT_CLASS(pidgin_encrypt_parent_class)->finalize(obj); } @@ -241,8 +241,8 @@ g_hash_table_remove(priv->auth_controls, participant); if (g_hash_table_size(priv->auth_controls) == 0) - purple_debug_info(PLUGIN_ID, - "gtk: _remove_call(): No auth_control entries left.\n"); + purple_debug_info(PLUGIN_ID " UI", + "_remove_call(): No auth_control entries left.\n"); } static GtkWidget * @@ -271,7 +271,7 @@ gtk_button_set_relief(GTK_BUTTON(call->authimg), GTK_RELIEF_NONE); gtk_box_pack_start(GTK_BOX(call->controlbox), call->authimg, TRUE, FALSE, 0); - purple_debug_info(PLUGIN_ID, "_add controlbox(): authimg=%p(%s) image=%p(%s) label=%p(%s)\n", + purple_debug_info(PLUGIN_ID " UI", "_add controlbox(): authimg=%p(%s) image=%p(%s) label=%p(%s)\n", call->authimg, gtk_widget_get_name(call->authimg), call->image, gtk_widget_get_name(call->image), call->label, gtk_widget_get_name(call->label)); @@ -424,7 +424,7 @@ { gboolean show_authbox = gtk_toggle_button_get_active(authimg); - purple_debug_info("PidginEncrypt [zrtp]", "authimg_clicked_cb() called: %s.\n", + purple_debug_info(PLUGIN_ID " UI", "authimg_clicked_cb() called: %s.\n", show_authbox ? "True":"False"); } @@ -440,7 +440,7 @@ mediawindow = GTK_WIDGET(g_object_get_data(G_OBJECT(media), "simplezrtp/media-window")); if (!GTK_IS_WINDOW(mediawindow)) { - purple_debug_info(PLUGIN_ID, "get_parentbox(): no access to PidginMedia window.\n"); + purple_debug_info(PLUGIN_ID " UI", "get_parentbox(): no access to PidginMedia window.\n"); return NULL; } @@ -460,14 +460,14 @@ "box", parentbox, NULL); - purple_debug_info(PLUGIN_ID, "gtk: media_new(encrypt %p)\n", encrypt); + purple_debug_info(PLUGIN_ID " UI", "media_new(encrypt %p)\n", encrypt); } static void media_end(PurpleEncrypt *encrypt) { PidginEncrypt *self = purple_encrypt_get_ui_data(encrypt); - purple_debug_info(PLUGIN_ID, "gtk: media_end(encrypt %p)\n", encrypt); + purple_debug_info(PLUGIN_ID " UI", "media_end(encrypt %p)\n", encrypt); g_object_unref(self); } @@ -477,14 +477,14 @@ if (!pidgin_encrypt_get_call(self, participant)) pidgin_encrypt_call_new(self, participant); - purple_debug_info(PLUGIN_ID, "gtk: call_new(encrypt %p, participant %s)\n", + purple_debug_info(PLUGIN_ID " UI", "call_new(encrypt %p, participant %s)\n", encrypt, participant); } static void call_end(PurpleEncrypt *encrypt, const gchar *participant) { PidginEncrypt *self = purple_encrypt_get_ui_data(encrypt); - purple_debug_info(PLUGIN_ID, "gtk: call_end(encrypt %p, participant %s)\n", + purple_debug_info(PLUGIN_ID " UI", "call_end(encrypt %p, participant %s)\n", encrypt, participant); pidgin_encrypt_call_destroy(self, participant); @@ -500,7 +500,7 @@ recv = pidgin_encrypt_get_call(self, participant); - purple_debug_info("PidginEncrypt [zrtp]", "set_auth_msg(self=%p, participant=%s): recv=%p; %s.\n", + purple_debug_info(PLUGIN_ID " UI", "set_auth_msg(self=%p, participant=%s): recv=%p; %s.\n", self, participant, recv, msg); if (recv) { gtk_label_set_text(GTK_LABEL(recv->msgwidget), msg); @@ -516,7 +516,7 @@ gint img_state = 0; g_return_if_fail(PIDGIN_IS_ENCRYPT(self)); - purple_debug_info("PidginEncrypt [zrtp]", + purple_debug_info(PLUGIN_ID " UI", "update_auth_state(): state=0x%x, purpleEncrypt=%p, pidginEncrypt=%p, participant=%s, recv=%p.\n", state, encrypt, self, participant, recv); @@ -530,7 +530,7 @@ img_state = 1; else img_state = 0; - purple_debug_info("PidginEncrypt [zrtp]", "update_auth_state(): use img_state=%d.\n", img_state); + purple_debug_info(PLUGIN_ID " UI", "update_auth_state(): use img_state=%d.\n", img_state); gtk_widget_set_sensitive(recv->authbox, (state & PURPLE_ENCRYPT_STATE_ENC) != 0); @@ -542,7 +542,7 @@ GdkPixbuf *pixbuf = NULL; gchar *shorttext; - purple_debug_info("PidginEncrypt [zrtp]", + purple_debug_info(PLUGIN_ID " UI", "update_auth_state(): creating pixbuf(img_state=%d, data=%p).\n", img_state, states[img_state].pixbuf); @@ -551,7 +551,7 @@ if (pixbuf) g_object_unref(pixbuf); - purple_debug_info("PidginEncrypt [zrtp]", + purple_debug_info(PLUGIN_ID " UI", "update_auth_state(): setting image(img_state=%d): pixbuf=%p.\n", img_state, pixbuf); @@ -572,7 +572,7 @@ PidginEncrypt *self = (PidginEncrypt *) purple_encrypt_get_ui_data(encrypt); g_return_if_fail(PIDGIN_IS_ENCRYPT(self)); - purple_debug_warning(PLUGIN_ID " ui", "show_warning(participant=%s): %s (%s)\n", + purple_debug_warning(PLUGIN_ID " UI", "show_warning(participant=%s): %s (%s)\n", participant, msg, desc); } _______________________________________________ Pidgin-zrtp-commits mailing list Pidgin-zrtp-commits@gna.org https://mail.gna.org/listinfo/pidgin-zrtp-commits