def METHOD_NAME(log_file=None, name='root', log_level=logging.DEBUG):
    logger = logging.getLogger(name)
    formatter = logging.Formatter(
        '[%(asctime)s] %(name)s %(levelname)s: %(message)s',
        datefmt="%Y/%m/%d %H:%M:%S")
    stream_handler = logging.StreamHandler(stream=sys.stdout)
    stream_handler.setFormatter(formatter)
    logger.addHandler(stream_handler)
    if log_file is not None:
        dir_name = os.path.dirname(log_file)
        if len(dir_name) > 0 and not os.path.exists(dir_name):
            os.makedirs(dir_name)
        file_handler = logging.FileHandler(log_file, 'w')
        file_handler.setFormatter(formatter)
        logger.addHandler(file_handler)
    logger.setLevel(log_level)
    return logger