'Emit a log message on my socket.'

def emit(self, record):

    try:
        (topic, record.msg) = record.msg.split(TOPIC_DELIM, 1)
    except Exception:
        topic = ''
    try:
        bmsg = cast_bytes(self.format(record))
    except Exception:
        self.handleError(record)
        return
    topic_list = []
    if self.root_topic:
        topic_list.append(self.root_topic)
    topic_list.append(record.levelname)
    if topic:
        topic_list.append(topic)
    btopic = '.'.join((cast_bytes(t) for t in topic_list))
    self.socket.send_multipart([btopic, bmsg])
