code: def capture(self, event_type, date=None, context=None, custom=None, stack=None, handled=True, **kwargs):
          
          if event_type == "Exception":
              # never gather log stack for exceptions
              stack = False
          data = self._build_msg_for_logging(
              event_type, date=date, context=context, custom=custom, stack=stack, handled=handled, **kwargs
          )
  
          if data:
              # queue data, and flush the queue if this is an unhandled exception
              self.queue(ERROR, data, flush=not handled)
              return data["id"]
docs: Captures and processes an event and pipes it off to Client.send.