Pickles the record in binary format with a length prefix, and returns it ready for transmission across the socket.
(self, record)
| 647 | self.sock = None # so we can call createSocket next time |
| 648 | |
| 649 | def makePickle(self, record): |
| 650 | """ |
| 651 | Pickles the record in binary format with a length prefix, and |
| 652 | returns it ready for transmission across the socket. |
| 653 | """ |
| 654 | ei = record.exc_info |
| 655 | if ei: |
| 656 | # just to get traceback text into record.exc_text ... |
| 657 | dummy = self.format(record) |
| 658 | # See issue #14436: If msg or args are objects, they may not be |
| 659 | # available on the receiving end. So we convert the msg % args |
| 660 | # to a string, save it as msg and zap the args. |
| 661 | d = dict(record.__dict__) |
| 662 | d['msg'] = record.getMessage() |
| 663 | d['args'] = None |
| 664 | d['exc_info'] = None |
| 665 | # Issue #25685: delete 'message' if present: redundant with 'msg' |
| 666 | d.pop('message', None) |
| 667 | s = pickle.dumps(d, 1) |
| 668 | slen = struct.pack(">L", len(s)) |
| 669 | return slen + s |
| 670 | |
| 671 | def handleError(self, record): |
| 672 | """ |