  def format(self, record: logging.LogRecord) -> str:
    """Hooks the native format method and colorizes messages if needed.

    Args:
      record (logging.LogRecord): Native log record.

    Returns:
      str: The formatted message string.
    """
    if self.colorize:
      message = record.getMessage()
      loglevel_color = LEVEL_COLOR_MAP.get(record.levelname)
      if loglevel_color:
        message = loglevel_color + message + RESET_SEQ
      record.msg = message
    return super().format(record)
Hooks the native format method and colorizes messages if needed.

Args:
record (logging.LogRecord): Native log record.

Returns:
str: The formatted message string.
libcloudforensics/logging_utils.py