def init_logger(root_dir, name="<STR_LIT>"):
os.makedirs(root_dir, exist_ok=True)<EOL>log_formatter = logging.Formatter("<STR_LIT>")<EOL>logger = logging.getLogger(name)<EOL>file_handler = logging.FileHandler("<STR_LIT>".format(root_dir, name), mode='<STR_LIT:w>')<EOL>file_handler.setFormatter(log_formatter)<EOL>logger.addHandler(file_handler)<EOL>console_handler = logging.StreamHandler()<EOL>console_handler.setFormatter(log_formatter)<EOL>logger.addHandler(console_handler)<EOL>logger.setLevel(logging.INFO)<EOL>return logger<EOL>
Initialize a logger

    Parameters
    ----------
    root_dir : str
        directory for saving log
    name : str
        name of logger

    Returns
    -------
    logger : logging.Logger
        a logger