Add debugging to event system [native and javascript]