def remove_file(filename, verbose=True):
    """
    Attempt to delete filename.
    log is boolean. If true, removal is logged.
    Log a warning if file does not exist.
    Logging filenames are relative to config.BASE_DIR to cut down on noise in output.
    """
    if verbose:
        LOG.info('Deleting file %s', os.path.relpath(filename, config.BASE_DIR))
    if not os.path.exists(filename):
        LOG.warning("File does not exist: %s", os.path.relpath(filename, config.BASE_DIR))
    else:
        os.remove(filename)
Attempt to delete filename.
    log is boolean. If true, removal is logged.
    Log a warning if file does not exist.
    Logging filenames are relative to config.BASE_DIR to cut down on noise in output.