<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def record_download_archive(track):
 """ Write the track_id in the download archive """

    global arguments
    if not arguments['--download-archive']:
        return

    archive_filename = arguments.get('--download-archive')
    try:
        with open(archive_filename, 'a', encoding='utf-8') as file:
            file.write('{0}'.format(track['id'])+'\n')
    except IOError as ioe:
        logger.error('Error trying to write to download archive...')
        logger.debug(ioe)