Commit 44d094f5 authored by JC Brand's avatar JC Brand

Add a debug option (logs to browser console)

parent 53359b7d
......@@ -6,6 +6,7 @@ Changelog
- Register presence and message handlers before fetching the roster. Otherwise
some presence notifications might be missed. [jcbrand]
- Add a debug option (logs to the browser console). [jcbrand]
0.5.2 (2013-08-05)
------------------
......
......@@ -48,6 +48,7 @@
this.auto_list_rooms = false;
this.auto_subscribe = false;
this.bosh_service_url = ''; // The BOSH connection manager URL. Required if you are not prebinding.
this.debug = false;
this.hide_muc_server = false;
this.i18n = locales.en;
this.prebind = false;
......@@ -2614,8 +2615,13 @@
this.onConnected = function (connection, callback) {
this.connection = connection;
if (this.debug) {
this.connection.xmlInput = function (body) { console.log(body); };
this.connection.xmlOutput = function (body) { console.log(body); };
Strophe.log = function (level, msg) {
console.log(level+' '+msg);
};
}
this.bare_jid = Strophe.getBareJidFromJid(this.connection.jid);
this.domain = Strophe.getDomainFromJid(this.connection.jid);
this.features = new this.Features();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment