def send_event(self, event_name, data, channel_name=None):
event = {'<STR_LIT>': event_name, '<STR_LIT:data>': data}<EOL>if channel_name:<EOL><INDENT>event['<STR_LIT>'] = channel_name<EOL><DEDENT>self.logger.info("<STR_LIT>" % event)<EOL>try:<EOL><INDENT>self.socket.send(json.dumps(event))<EOL><DEDENT>except Exception as e:<EOL><INDENT>self.logger.error("<STR_LIT>" % e)<EOL><DEDENT>
Send an event to the Pusher server.

        :param str event_name:
        :param Any data:
        :param str channel_name: