Skip to content

Commit

Permalink
Merge pull request #2127 from bencomp/775-logger-refs
Browse files Browse the repository at this point in the history
Replace System.out.print with logger.X in some files
  • Loading branch information
scolapasta committed May 19, 2015
2 parents 289690d + 48ee7ea commit 4aef024
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 13 deletions.
2 changes: 1 addition & 1 deletion src/main/java/edu/harvard/iq/dataverse/DatasetField.java
Original file line number Diff line number Diff line change
Expand Up @@ -376,7 +376,7 @@ public boolean isRequired() {
}

}
// System.out.print("at return " + this.datasetFieldType.getDisplayName() + " " + required);
// logger.fine("at return " + this.datasetFieldType.getDisplayName() + " " + required);
return required;
}

Expand Down
9 changes: 4 additions & 5 deletions src/main/java/edu/harvard/iq/dataverse/DatasetPage.java
Original file line number Diff line number Diff line change
Expand Up @@ -726,8 +726,8 @@ private void updateDatasetFieldInputLevels() {
}

public void handleChange() {
System.out.print("handle change");
System.out.print("new value " + selectedTemplate.getId());
logger.info("handle change");
logger.info("new value " + selectedTemplate.getId());
}

public void handleChangeButton() {
Expand Down Expand Up @@ -790,7 +790,7 @@ public MapLayerMetadata getMapLayerMetadata(DataFile df) {
}

private void msg(String s){
//System.out.println(s);
//logger.fine(s);
}

/**
Expand Down Expand Up @@ -957,7 +957,7 @@ private void loadMapLayerMetadataLookup() {


public String init() {
// System.out.println("_YE_OLDE_QUERY_COUNTER_"); // for debug purposes
// logger.fine("_YE_OLDE_QUERY_COUNTER_"); // for debug purposes
String nonNullDefaultIfKeyNotFound = "";
this.maxFileUploadSizeInBytes = systemConfig.getMaxFileUploadSize();

Expand Down Expand Up @@ -1620,7 +1620,6 @@ public String saveLinkedDataset() {

} catch (CommandException ex) {
String msg = "There was a problem linking this dataset to yours: " + ex;
System.out.print("in catch exception... " + ex);
logger.severe(msg);
/**
* @todo how do we get this message to show up in the GUI?
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,8 @@ public RetrieveDatasetVersionResponse(DatasetVersion datasetVersion, String requ
if (datasetVersion == null){
throw new IllegalArgumentException("datasetVersion cannot be null");
}
//System.out.println("RetrieveDatasetVersionResponse: datasetVersion: " + datasetVersion.getSemanticVersion() + " requestedVersion: " + requestedVersion);
//System.out.println("chosenVersion id: " + datasetVersion.getId() + " getFriendlyVersionNumber: " + datasetVersion.getFriendlyVersionNumber());
//logger.fine("RetrieveDatasetVersionResponse: datasetVersion: " + datasetVersion.getSemanticVersion() + " requestedVersion: " + requestedVersion);
//logger.fine("chosenVersion id: " + datasetVersion.getId() + " getFriendlyVersionNumber: " + datasetVersion.getFriendlyVersionNumber());
this.datasetVersionForResponse = datasetVersion;

this.actualVersion = datasetVersion.getSemanticVersion();
Expand Down Expand Up @@ -97,7 +97,7 @@ private void checkVersion(){
if (actualVersion==null){ // this shouldn't happen
return;
}
//System.out.println("check version. requested: " + this.requestedVersion + " returned: " + actualVersion);
//logger.fine("check version. requested: " + this.requestedVersion + " returned: " + actualVersion);
// This may often be the case if version is not specified
//
if (requestedVersion == null || requestedVersion.equals("")){
Expand Down Expand Up @@ -161,7 +161,7 @@ public DatasetVersion findByFriendlyVersionNumber(Long datasetId, String friendl
query.setParameter("minorVersionNumber", minorVersionNumber);
foundDatasetVersion = (DatasetVersion) query.getSingleResult();
} catch (javax.persistence.NoResultException e) {
System.out.print("no ds version found: " + datasetId + " " + friendlyVersionNumber);
logger.warning("no ds version found: " + datasetId + " " + friendlyVersionNumber);
// DO nothing, just return null.
}
return foundDatasetVersion;
Expand Down Expand Up @@ -195,7 +195,7 @@ public DatasetVersion findByFriendlyVersionNumber(Long datasetId, String friendl
return retVal;

} catch (javax.persistence.NoResultException e) {
System.out.print("no ds version found: " + datasetId + " " + friendlyVersionNumber);
logger.warning("no ds version found: " + datasetId + " " + friendlyVersionNumber);
// DO nothing, just return null.
}

Expand Down Expand Up @@ -247,7 +247,7 @@ public Long[] parseVersionNumber(String version){


private void msg(String s){
//System.out.println(s);
//logger.fine(s);
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import edu.harvard.iq.dataverse.util.LruCache;
import java.util.List;
import java.util.Set;
import java.util.logging.Logger;
import javax.ejb.Stateless;
import javax.inject.Named;
import javax.persistence.EntityManager;
Expand All @@ -23,6 +24,7 @@
@Named
public class DataverseFieldTypeInputLevelServiceBean {

// private static final Logger logger = Logger.getLogger(DataverseFieldTypeInputLevelServiceBean.class.getCanonicalName());
public static final LruCache<Long, List<DataverseFieldTypeInputLevel>> cache = new LruCache();

@PersistenceContext(unitName = "VDCNet-ejbPU")
Expand All @@ -42,7 +44,7 @@ public List<DataverseFieldTypeInputLevel> findByDataverseId(Long dataverseId) {
}

private void msg(String s){
//System.out.println(s);
//logger.fine(s);
}

/**
Expand Down

0 comments on commit 4aef024

Please sign in to comment.