'Pickles the record in binary format with a length prefix, and
returns it ready for transmission across the socket.'

def makePickle(self, record):

    ei = record.exc_info
    if ei:
        dummy = self.format(record)
    d = dict(record.__dict__)
    d['msg'] = record.getMessage()
    d['args'] = None
    d['exc_info'] = None
    s = pickle.dumps(d, 1)
    slen = struct.pack('>L', len(s))
    return (slen + s)
