code: def emit(self, record):
          
          # Skip records less than min_level
          if record.levelno < logging.getLevelName(self.min_level):
              return
  
          evt = LogEvent()
          evt.level = record.levelname
          evt.levelno = record.levelno
          evt.timestamp = datetime.fromtimestamp(record.created)
          evt.message = record.message
          evt.filename = record.filename
          evt.lineno = record.lineno
          evt.module = record.module
          evt.funcname = record.funcName
          evt.pathname = record.pathname
          evt.process_id = record.process
  
          # Only log stacktraces if its the level is ERROR or higher
          if record.levelno >= 40:
              evt.stacktrace = traceback.format_exc()
  
          try:
              db.session.add(evt)
              db.session.commit()
          except Exception:
              db.session.rollback()
docs: Persist a record into the database
  
          Args:
              record (`logging.Record`): The logging.Record object to store
  
          Returns:
              `None`