'Download the PlexPy log file.'

@cherrypy.expose
@requireAuth(member_of('admin'))
@addtoapi()
def download_log(self, **kwargs):

    log_file = logger.FILENAME
    try:
        logger.logger.flush()
    except:
        pass
    return serve_download(os.path.join(plexpy.CONFIG.LOG_DIR, log_file), name=log_file)
