def METHOD_NAME(self, record) -> str:
    # Capture and remove exc_info and stack_info so the superclass format() doesn't
    # print it and we can control the formatting.
    exc_info = record.exc_info
    record.exc_info = None
    stack_info = record.stack_info
    record.stack_info = None
    # Add colors to the record.
    if self._use_color:
        record.lvlcolor = self.LEVEL_COLORS.get(record.levelname, '')
        # Colorise the line.
        record.msgcolor = self.MESSAGE_COLORS.get(record.levelname, '')
        # Fixed colors.
        record.timecolor = Fore.BLUE
        record._reset = Style.RESET_ALL
        record._dim = Style.DIM
    else:
        record.lvlcolor = ""
        record.msgcolor = ""
        record.timecolor = ""
        record._reset = ""
        record._dim = ""
    record.message = record.getMessage()
    # Add levelname alignment to record.
    record.levelname_align = " " * max(self.MAX_LEVELNAME_WIDTH - len(record.levelname), 0)
    record.levelnamewidth = self.MAX_LEVELNAME_WIDTH
    # Let superclass handle formatting.
    log_msg = super().METHOD_NAME(record)
    # Append uncolored exception/stack info.
    if exc_info:
        log_msg += "\n" + Style.DIM + self.formatException(exc_info) + Style.RESET_ALL
    if stack_info:
        log_msg += "\n" + Style.DIM + self.formatStack(stack_info) + Style.RESET_ALL
    return log_msg