def METHOD_NAME(self, record: logging.LogRecord) -> None:
    try:
        self.format(record)
        if self.can_record(record):
            self._emit(record)
        else:
            self.carp(record.message)
    except Exception:
        if self.client.raise_send_errors:
            raise
        self.carp(
            "Top level Sentry exception caught - failed " "creating log record"
        )
        self.carp(record.msg)
        self.carp(traceback.format_exc())