def set_logger_dir(dirname, action=None):
    global LOG_FILE, LOG_DIR
    if os.path.isdir(dirname):
        logger.warn("""\
Directory {} exists! Please either backup/delete it, or use a new directory \
unless you're resuming from a previous task.""".format(dirname))
        logger.info("Select Action: k (keep) / b (backup) / d (delete) / n (new):")
        if not action:
            while True:
                act = input().lower().strip()
                if act:
                    break
        else:
            act = action
        if act == 'b':
            backup_name = dirname + get_time_str()
            shutil.move(dirname, backup_name)
            info("Directory'{}' backuped to '{}'".format(dirname, backup_name))
        elif act == 'd':
            shutil.rmtree(dirname)
        elif act == 'n':
            dirname = dirname + get_time_str()
            info("Use a different log directory {}".format(dirname))
        elif act == 'k':
            pass
        else:
            raise ValueError("Unknown action: {}".format(act))
    LOG_DIR = dirname
    mkdir_p(dirname)
    LOG_FILE = os.path.join(dirname, 'log.log')
    _set_file(LOG_FILE)


# export logger functions
List all buffers in segment_info format
dataset/ETHPy150Open ppwwyyxx/tensorpack/tensorpack/utils/logger.py/set_logger_dir--crossover with--dataset/ETHPy150Open powerline/powerline/powerline/listers/vim.py/bufferlister