def emit(self, record):
        """Send a LogRecord to the callback function, after preparing it
        for serialization."""
        try:
            self._callback(self.prepare(record))
        except Exception:
            self.handleError(record)