code: def log(self, cause=None, do_message=True, custom_msg=None):
          
          message = error_message(self, cause=cause)
          exc_type, exc_value, exc_traceback = sys.exc_info()
          traceback_formatted = traceback.format_exc()
          traceback_val = traceback.extract_tb(exc_traceback)
  
          md5 = hashlib.md5(traceback_formatted.encode('utf-8')).hexdigest()
  
          if md5 in self._db:
              # self.logger.debug('Exception trace logged: %s' % md5)
              return
  
          if custom_msg is not None and cause is not None:
              self.logger.debug('%s : %s' % (custom_msg, cause))
          elif custom_msg is not None:
              self.logger.debug(custom_msg)
          elif cause is not None:
              self.logger.debug('%s' % cause)
  
          self.logger.debug(traceback_formatted)
          self._db.add(md5)
docs: Loads exception data from the current exception frame - should be called inside the except block
          :return: