code: def format(self, record: logging.LogRecord) -> str:
          
  
          # message = super().format(record)
          super().format(record)
          # Since fmt does not contain asctime, the Formatter.format()
          # will not write asctime (since its usesTime()) function will be
          # false. Therefore:
          record.asctime = self.formatTime(record, self.datefmt)
          bg_col = self.log_background_colors[record.levelno]
          msg = escape(record.getMessage())
          # escape() won't replace \n but will replace & etc.
          if self.replace_nl_with_br:
              msg = msg.replace("\n", "<br>")
          html = (
              '<span style="color:#008B8B">{time}.{ms:03d} {name}:{lvname}: '
              '</span><span style="color:{color}{bg}">{msg}</font>{br}'.format(
                  time=record.asctime,
                  ms=int(record.msecs),
                  name=record.name,
                  lvname=record.levelname,
                  color=self.log_colors[record.levelno],
                  msg=msg,
                  bg=";background-color:{}".format(bg_col) if bg_col else "",
                  br="<br>" if self.append_br else "",
              )
          )
          # print("record.__dict__: {}".format(record.__dict__))
          # print("html: {}".format(html))
          return html
docs: Internal function to format the :class:`LogRecord` as HTML.
  
          See https://docs.python.org/3.4/library/logging.html#logging.LogRecord