def METHOD_NAME(
    self, name_levels: Dict[str, int], add_default_handler: bool = True
) -> None:
    """Set logging levels for module names.
    Args:
        name_levels: Dictionary of module names (qiskit_nature.second_q, qiskit.algorithms etc)
                     to desired level
        add_default_handler: add or not the default stream handler
    """
    names: List[str] = []
    for name, level in name_levels.items():
        names.append(name)
        logger = python_logging.getLogger(name)
        logger.setLevel(level)
        logger.propagate = False
        handlers = logger.handlers
        if add_default_handler and not any(
            isinstance(h, _DefaultStreamHandler) for h in handlers
        ):
            self.add_handler(name, _DefaultStreamHandler())