def log_events(klass):
 old_event = klass.event
 @functools.wraps(old_event)
 def new_event(self, e, *args, **kwargs):
  'Wrapper for event() which logs events.'
  log.misc.debug('Event in {}: {}'.format(utils.qualname(klass), qenum_key(QEvent, e.type())))
  return old_event(self, e, *args, **kwargs)
 klass.event = new_event
 return klass

def log_events ( klass ) : old_event = klass . event @ functools . wraps ( old_event ) def new_event ( self , e , * args , ** kwargs ) : log . misc . debug ( 'Event in {}: {}' . format ( utils . qualname ( klass ) , qenum_key ( QEvent , e . type ( ) ) ) ) return old_event ( self , e , * args , ** kwargs ) klass . event = new_event return klass
class decorator to log qt events .