def log_message(*args, level: str = "info"):
    """
    Log a message to the logger.

    Args:
        *args: The message to log.
        level (str): The logging level.
    """
    logger = logging.getLogger(__name__)
    if level == "info":
        logger.info(*args)
    elif level == "warning":
        logger.warning(*args)
    elif level == "error":
        logger.error(*args)
    elif level == "print":
        print(*args)
    else:
        raise ValueError(f"Invalid logging level: {level}")

    Log a message to the logger.

    Args:
        *args: The message to log.
        level (str): The logging level.
    
opensora/utils/logger.py