def __getattr__(self, name):
    if name.startswith('on_'):
        return partial(self.log_event, event_name=name)
def __getattr__(self, name):
    if name.startswith('on_'):
        return partial(self.log_event, event_name=name)