Use logging system instead of stderr

This commit is contained in:
Ron Levine 2015-01-05 14:04:10 -05:00
parent 64375f6341
commit b4fda38922
3 changed files with 11 additions and 5 deletions

View File

@ -51,6 +51,7 @@
package org.broadinstitute.gatk.utils.pairhmm;
import org.apache.log4j.Logger;
import org.broadinstitute.gatk.utils.exceptions.UserException;
import org.broadinstitute.gatk.utils.genotyper.ReadLikelihoods;
import org.broadinstitute.gatk.utils.haplotype.Haplotype;
@ -70,6 +71,8 @@ import java.util.Map;
*/
public class VectorLoglessPairHMM extends JNILoglessPairHMM {
protected final static Logger logger = Logger.getLogger(VectorLoglessPairHMM.class);
//Used to copy references to byteArrays to JNI from reads
protected class JNIReadDataHolderClass {
public byte[] readBases = null;
@ -264,7 +267,7 @@ public class VectorLoglessPairHMM extends JNILoglessPairHMM {
@Override
public void close() {
if (doProfiling)
System.err.println("Time spent in setup for JNI call : " + (pairHMMSetupTime * 1e-9));
logger.info("Time spent in setup for JNI call : " + (pairHMMSetupTime * 1e-9));
super.close();
jniClose();
}

View File

@ -25,6 +25,7 @@
package org.broadinstitute.gatk.utils.vectorpairhmm;
import org.apache.log4j.Logger;
import java.util.List;
import java.util.LinkedList;
import java.util.Map;
@ -37,6 +38,8 @@ import java.io.InputStreamReader;
public class Sandbox {
protected final static Logger logger = Logger.getLogger(Sandbox.class);
private long setupTime = 0;
private long computeTime = 0;
//Used to copy references to byteArrays to JNI from reads
@ -156,7 +159,7 @@ public class Sandbox {
public native void jniClose();
public void close()
{
System.err.println("Time spent in setup for JNI call : "+(setupTime*1e-9)+" compute time : "+(computeTime*1e-9));
logger.info("Time spent in setup for JNI call : "+(setupTime*1e-9)+" compute time : "+(computeTime*1e-9));
jniClose();
}
@ -170,8 +173,8 @@ public class Sandbox {
}
catch(FileNotFoundException e)
{
System.err.println("File "+filename+" cannot be found/read");
return;
logger.info("File "+filename + " cannot be found/read");
return;
}
int idx = 0;
int numReads = 0;

View File

@ -385,6 +385,6 @@ public abstract class PairHMM {
public void close()
{
if(doProfiling)
System.err.println("Total compute time in PairHMM computeLikelihoods() : "+(pairHMMComputeTime*1e-9));
logger.info("Total compute time in PairHMM computeLikelihoods() : "+(pairHMMComputeTime*1e-9));
}
}