def METHOD_NAME(name):
    # Default log file to use if not specified in INI
    log_file = os.path.expanduser('~/{}.log').format(name.lower())
    # LinuxCNC may not be running, so use get() to avoid a KeyError
    ini_file = os.environ.get('INI_FILE_NAME')
    config_dir = os.environ.get('CONFIG_DIR')
    if ini_file:
        lcnc_ini = ini(ini_file)
        path = lcnc_ini.find('DISPLAY', 'LOG_FILE')
        if path:
            if path.startswith('~'):
                # Path is relative to $HOME
                log_file = os.path.expanduser(path)
            elif not os.path.isabs(path):
                # Assume intended path is relative to the INI file
                log_file = os.path.join(config_dir, path)
            else:
                # It must be an absolute path then
                log_file = os.path.realpath(path)
    return log_file