PDA

View Full Version : Debugging - Global Event Listener?



lukefowell89
16 Dec 2010, 1:59 AM
I am having real problems debugging an issue I have at the moment, is it possible and if so how would I go about console logging every event that fires, so I can track what events are going off when etc.

Anyone?

mankz
16 Dec 2010, 2:28 AM
Ext.util.Observable.prototype.fireEvent = Ext.util.Observable.prototype.fireEvent.createSequence(console.log);

Condor
16 Dec 2010, 2:32 AM
Ext.util.Observable.capture and Ext.util.Observable.observeClass can come in handy here too.

lukefowell89
16 Dec 2010, 2:43 AM
Perfect thanks!

lukefowell89
16 Dec 2010, 2:49 AM
How do I use capture and observeClass?

Thanks

Condor
16 Dec 2010, 3:41 AM
Ext.util.Observable.capture(messageBus, console.log);
or

Ext.util.Observable.observeClass(Ext.util.Observable, {
myevent: console.log
});