package uk.ac.ebi.spot.goci.service;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import uk.ac.ebi.spot.goci.model.Association;
import uk.ac.ebi.spot.goci.repository.AssociationRepository;

import java.util.Date;

/**
 * Created by emma on 07/08/2015.
 *
 * @author emma
 *         <p>
 *         Service that updates an associations lastMappedDate and lastMappingPerformedBy information.
 */
@Service
public class MappingRecordService {

    private AssociationRepository associationRepository;

    private final Logger log = LoggerFactory.getLogger(getClass());

    protected Logger getLog() {
        return log;
    }

    // Constructor
    @Autowired
    public MappingRecordService(AssociationRepository associationRepository) {
        this.associationRepository = associationRepository;
    }

    /**
     * Update mapping record for an association
     *
     * @param association Association to update
     * @param mappingDate Date of mapping pipeline run
     * @param mappedBy    Name of curator or process that ran mapping
     */
    public void updateAssociationMappingRecord(Association association, Date mappingDate, String mappedBy) {
        getLog().info("Updating association: " + association.getId() + ". Setting LAST_MAPPING_DATE to " + mappedBy +
                              ". Setting LAST_MAPPING_PERFORMED_BY to " + mappedBy);
        association.setLastMappingDate(mappingDate);
        association.setLastMappingPerformedBy(mappedBy);
        associationRepository.save(association);
    }

}

@@ -1278,211 +1278,8 @@
 ) %7B%0A
-        getLog().info(%22Updating association: %22 + association.getId() + %22. Setting LAST_MAPPING_DATE to %22 + mappedBy +%0A                              %22. Setting LAST_MAPPING_PERFORMED_BY to %22 + mappedBy);%0A
     

Remove log statement