我正在尝试修复Candy.js (它使用Strophe.js)的一个问题,在这个问题中我们使用Candy.core.attach (在服务器端预绑定之后)。
有一个问题我可以解决。我真的希望能够访问strophe.js日志(而不仅仅是candy从strophe捕获的数据包日志)。我知道strophe有低级别的日志记录,我怎么才能得到糖果来使用它呢?
发布于 2014-09-17 20:45:32
在init中,将debug设置为true
Candy.init($('BoshPath').val(), {
core: { debug: true, autojoin: [chatroom] },
view: {
resources: '/scripts/Candy/res/', crop: {
message: { nickname: 18, body: 250 },
roster: { nickname: 21 }
}
}
});另外,在Candy中,找到"self.init = function (service,options)“行(在130ish行附近)。如果您愿意,您可以进行自定义。
if (_options.debug) {
self.log = function (str) {
try { // prevent erroring
if (typeof window.console !== undefined && typeof window.console.log !== undefined) {
console.log(str);
}
} catch (e) { }
};
self.log('[Init] Debugging enabled');
}发布于 2014-09-19 01:54:24
我最终修改了candy/strophe的本地副本,以启用我正在寻找的低级日志记录,因为Candy似乎没有提供启用strophe低级日志记录的方法。
https://stackoverflow.com/questions/25874760
复制相似问题