(self, event, *args, **kwargs)
Global Event Handler

        Event handler to listen to all events printing
        each event to self.file or a Logger Component instance
        by calling self.logger.debug
Global Event Handler
Global Event Handler
def _on_event(self, event, *args, **kwargs):
        """Global Event Handler

        Event handler to listen to all events printing
        each event to self.file or a Logger Component instance
        by calling self.logger.debug
        """

        try:
            if not self._events:
                return

            channels = event.channels

            if event.name in self.IgnoreEvents:
                return

            if all(channel in self.IgnoreChannels for channel in channels):
                return

            s = repr(event)

            if self.prefix:
                s = "%s: %s" % (self.prefix, s)

            if self.trim:
                s = "%s ...>" % s[:self.trim]

            if self.logger is not None:
                self.logger.debug(s)
            else:
                self.file.write(s)
                self.file.write("\n")
                self.file.flush()
        except Exception as e:
            sys.stderr.write("ERROR (Debugger): {}".format(e))
            sys.stderr.write("{}".format(format_exc()))
def _on_event ( self , event , * args , * * kwargs ) : try : if not self . _events : return channels = event . channels if event . name in self . IgnoreEvents : return if all ( channel in self . IgnoreChannels for channel in channels ) : return s = repr ( event ) if self . prefix : s = "%s: %s" % ( self . prefix , s ) if self . trim : s = "%s ...>" % s [ : self . trim ] if self . logger is not None : self . logger . debug ( s ) else : self . file . write ( s ) self . file . write ( "\n" ) self . file . flush ( ) except Exception as e : sys . stderr . write ( "ERROR (Debugger): {}" . format ( e ) ) sys . stderr . write ( "{}" . format ( format_exc ( ) ) )